]> Softwares of Agnibho - medscript.git/commitdiff
Bugfix: prescriber property from json
authorAgnibho Mondal <mondal@agnibho.com>
Tue, 7 Nov 2023 19:12:40 +0000 (00:42 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Tue, 7 Nov 2023 20:11:15 +0000 (01:41 +0530)
prescription.py

index 59fb733e1a41ebc9eaa989908c7d2850aa08973c..c7a7dca0512784fd63e60b38e1bf70f7be19f75e 100644 (file)
@@ -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)