From a9f8d3d7ee6f090cc531bec6f2bcecb872dc9eff Mon Sep 17 00:00:00 2001 From: Prafful Sharma <115104695+DraKen0009@users.noreply.github.com> Date: Mon, 3 Jun 2024 12:17:25 +0530 Subject: [PATCH] fixed data seeding issue (#2221) Co-authored-by: Vignesh Hari --- care/facility/management/commands/load_dummy_data.py | 1 + care/facility/models/patient_investigation.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/care/facility/management/commands/load_dummy_data.py b/care/facility/management/commands/load_dummy_data.py index add8122875..f42ac0ceef 100644 --- a/care/facility/management/commands/load_dummy_data.py +++ b/care/facility/management/commands/load_dummy_data.py @@ -30,5 +30,6 @@ def handle(self, *args, **options): self.BASE_URL + "users.json", self.BASE_URL + "facility.json", ) + management.call_command("populate_investigations") except Exception as e: raise CommandError(e) diff --git a/care/facility/models/patient_investigation.py b/care/facility/models/patient_investigation.py index e9fec6b3af..00a9e4c202 100644 --- a/care/facility/models/patient_investigation.py +++ b/care/facility/models/patient_investigation.py @@ -29,7 +29,8 @@ class PatientInvestigation(BaseModel): choices = models.TextField(null=True, blank=True) def __str__(self) -> str: - return self.name + " in " + self.unit + " as " + self.investigation_type + unit_part = f" in {self.unit}" if self.unit else "" + return f"{self.name}{unit_part} as {self.investigation_type}" class InvestigationSession(BaseModel):