diff --git a/fir_ser/api/utils/sysconfig.py b/fir_ser/api/utils/sysconfig.py index 76b6a80..2db216f 100644 --- a/fir_ser/api/utils/sysconfig.py +++ b/fir_ser/api/utils/sysconfig.py @@ -33,7 +33,14 @@ class ConfigCacheBase(object): def get_value_from_db(self, key): sys_obj = SystemConfig.objects.filter(key=key).first() - return SystemConfigSerializer(sys_obj).data + data = SystemConfigSerializer(sys_obj).data + value = data.get('value', '') + if value: + try: + data['value'] = json.loads(value) + except Exception as e: + logger.warning(f"db config - json loads failed {e}") + return data def get_value(self, key, data=None): if data is None: