admin: make YAMLField return empty dict when empty yaml is given
This commit is contained in:
parent
404c9ef753
commit
421bd13ddf
|
@ -53,6 +53,8 @@ class YAMLField(forms.JSONField):
|
||||||
)
|
)
|
||||||
if isinstance(converted, str):
|
if isinstance(converted, str):
|
||||||
return YAMLString(converted)
|
return YAMLString(converted)
|
||||||
|
if converted is None:
|
||||||
|
return {}
|
||||||
return converted
|
return converted
|
||||||
|
|
||||||
def bound_data(self, data, initial):
|
def bound_data(self, data, initial):
|
||||||
|
|
Reference in a new issue