v1.0.98: шаг6 — elements_json double-decode fix

This commit is contained in:
2026-06-22 07:48:01 +04:00
parent d39bf7c04f
commit 1315838507
+6
View File
@@ -144,9 +144,15 @@ class Handler(BaseHTTPRequestHandler):
if not docs:
continue
ej = docs[0]["elements_json"]
# Lucee JSONB может вернуть: строку, dict-обёртку {Value,Type}, или уже список
if isinstance(ej, dict) and "Value" in ej:
ej = ej["Value"]
if isinstance(ej, str):
elements = json.loads(ej)
elif isinstance(ej, list):
elements = ej
else:
elements = []
# Lucee serializeJSON → UPPERCASE keys, normalize to lowercase
elements = [{k.lower(): v for k, v in el.items()} for el in elements]
lines = []