Merge pull request #15340 from netchampfaris/meta-table-fields

fix: set empty lists for unset meta table fields
This commit is contained in:
Faris Ansari 2021-12-17 10:52:03 +05:30 committed by GitHub
commit 89648a5cf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -120,6 +120,11 @@ class Meta(Document):
or (not no_nulls and value is None)):
out[key] = value
# set empty lists for unset table fields
for table_field in DOCTYPE_TABLE_FIELDS:
if not out.get(table_field.fieldname):
out[table_field.fieldname] = []
return out
return serialize(self)