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