v1.1.30: fix json.loads('') in _resolve_ref_svc
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ from routes.api import bp as api_bp
|
|||||||
from routes.api_test import bp as api_test_bp
|
from routes.api_test import bp as api_test_bp
|
||||||
|
|
||||||
# Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI.
|
# Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI.
|
||||||
VERSION = "1.1.29"
|
VERSION = "1.1.30"
|
||||||
|
|
||||||
app = Flask(__name__, template_folder="templates", static_folder="static")
|
app = Flask(__name__, template_folder="templates", static_folder="static")
|
||||||
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc")
|
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc")
|
||||||
|
|||||||
@@ -291,7 +291,12 @@ def _resolve_ref_svc(client, cfs_params, params):
|
|||||||
if not isinstance(dd, dict):
|
if not isinstance(dd, dict):
|
||||||
continue
|
continue
|
||||||
pid = str(p["svcOperationCfsParamId"])
|
pid = str(p["svcOperationCfsParamId"])
|
||||||
user_val = json.loads(params.get(pid, "{}")) if pid in params else {}
|
user_val = {}
|
||||||
|
if pid in params:
|
||||||
|
try:
|
||||||
|
user_val = json.loads(params[pid]) if params[pid] else {}
|
||||||
|
except (json.JSONDecodeError, ValueError):
|
||||||
|
user_val = {}
|
||||||
for sk, sv in dd.items():
|
for sk, sv in dd.items():
|
||||||
ref_id = sv.get("refSvcId")
|
ref_id = sv.get("refSvcId")
|
||||||
if not ref_id:
|
if not ref_id:
|
||||||
|
|||||||
Reference in New Issue
Block a user