From 4e44dd3d8f5398aa73ae4545ac1dac6c5f32cc30 Mon Sep 17 00:00:00 2001 From: sayali Date: Thu, 29 Oct 2020 17:57:54 -0700 Subject: [PATCH] Check if authority options is JSON Array --- lemur/authorities/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lemur/authorities/models.py b/lemur/authorities/models.py index f042f773..61ab779e 100644 --- a/lemur/authorities/models.py +++ b/lemur/authorities/models.py @@ -93,9 +93,11 @@ class Authority(db.Model): if not self.options: return None - for option in json.loads(self.options): - if "name" in option and option["name"] == 'cab_compliant': - return option["value"] + options_array = json.loads(self.options) + if isinstance(options_array, list): + for option in options_array: + if "name" in option and option["name"] == 'cab_compliant': + return option["value"] return None