Fixed orjson incompatibility with empty values from 4.x db schema
This commit is contained in:
parent
e1a67b7306
commit
a3465d8e83
1 changed files with 3 additions and 2 deletions
|
|
@ -82,8 +82,9 @@ class JSONEncodedObj(sqlalchemy.types.TypeDecorator):
|
|||
try:
|
||||
value = ext_json.json.loads(value)
|
||||
except Exception:
|
||||
if self.safe and self.default is not None:
|
||||
return self.default()
|
||||
if self.safe:
|
||||
# Return default or empty dict for safety
|
||||
return self.default() if self.default is not None else {}
|
||||
else:
|
||||
raise
|
||||
return value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue