admin: make YAMLField return empty dict when empty yaml is given

This commit is contained in:
Jens Langhammer 2020-09-19 00:00:55 +02:00
parent 404c9ef753
commit 421bd13ddf
1 changed files with 2 additions and 0 deletions

View File

@ -53,6 +53,8 @@ class YAMLField(forms.JSONField):
)
if isinstance(converted, str):
return YAMLString(converted)
if converted is None:
return {}
return converted
def bound_data(self, data, initial):