Skip to content

Commit

Permalink
improve string repr
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Jul 14, 2023
1 parent 111a12e commit e9d5934
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion care/facility/models/prescription.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class MedibaseMedicine(BaseModel):
atc_classification = models.TextField(blank=True, null=True)

def __str__(self):
return " - ".join([self.name, self.generic or "", self.company or ""])
return " - ".join([i for i in [self.name, self.generic, self.company] if i])


class Prescription(BaseModel):
Expand Down

0 comments on commit e9d5934

Please sign in to comment.