From 4116ec33c55e2d63364b325bf991f3ab6f1a0074 Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Wed, 8 Nov 2023 00:42:40 +0530 Subject: [PATCH] Bugfix: prescriber property from json --- prescription.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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) -- 2.39.5