jsonalchemy: fix a case when default is not set and parsinge exception happens.
before: default could be undefined and raised an error.
This commit is contained in:
parent
bc23ad316c
commit
b6f2cdd95b
1 changed files with 1 additions and 1 deletions
|
|
@ -83,7 +83,7 @@ class JSONEncodedObj(sqlalchemy.types.TypeDecorator):
|
|||
try:
|
||||
value = json.loads(value, object_pairs_hook=DictClass)
|
||||
except Exception as e:
|
||||
if self.safe:
|
||||
if self.safe and self.default is not None:
|
||||
return self.default()
|
||||
else:
|
||||
raise
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue