From: Agnibho Mondal Date: Tue, 7 Nov 2023 19:12:40 +0000 (+0530) Subject: Bugfix: prescriber property from json X-Git-Tag: v0.5~50 X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=4116ec33c55e2d63364b325bf991f3ab6f1a0074;p=medscript.git Bugfix: prescriber property from json --- diff --git a/prescription.py b/prescription.py index 59fb733..c7a7dca 100644 --- a/prescription.py +++ b/prescription.py @@ -32,7 +32,10 @@ class Prescriber: self.address = data["address"] self.contact = data["contact"] self.extra = data["extra"] - self.properties = data["properties"] + if("properties" in data): + self.properties = data["properties"] + else: + self.properties = None except Exception as e: logging.warning(e) @@ -110,7 +113,10 @@ class Prescription: self.additional = data.get("additional") self.certificate = data.get("certificate") self.custom = data.get("custom") - self.properties = data.get("properties") + if("properties" in data): + self.properties = data["properties"] + else: + self.properties = None except Exception as e: logging.warning(e)