Forgot to change the cls=JSON inside the recursive call of UNSAFE_JSON

This commit is contained in:
Anton Hvornum 2021-11-09 19:23:29 +01:00
parent b7fcbf13bc
commit 4b4c66caa1
1 changed files with 3 additions and 3 deletions

View File

@ -121,11 +121,11 @@ class JsonEncoder:
for key, val in list(obj.items()):
if isinstance(val, dict):
# This, is a EXTREMELY ugly hack.. but it's the only quick way I can think of to trigger a encoding of sub-dictionaries.
val = json.loads(json.dumps(val, cls=JSON))
val = json.loads(json.dumps(val, cls=UNSAFE_JSON))
else:
val = JsonEncoder._encode(val)
val = JsonEncoder._unsafe_encode(val)
copy[JsonEncoder._encode(key)] = val
copy[JsonEncoder._unsafe_encode(key)] = val
return copy
else:
return JsonEncoder._encode(obj)