Skip to content

Commit

Permalink
Fixes string representation of MedibaseMedicine model (#1452)
Browse files Browse the repository at this point in the history
* fix repr of `MedibaseMedicine`

* improve string repr

* make it prettier :)
  • Loading branch information
rithviknishad authored Jul 14, 2023
1 parent 2933234 commit 43a47ea
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, self.company])
return " - ".join(filter(None, [self.name, self.generic, self.company]))


class Prescription(BaseModel):
Expand Down

0 comments on commit 43a47ea

Please sign in to comment.