Skip to content

Commit b71981f

Browse files
committed
bugfix: instance empty ListFields were not removed before saving, so they could be lost.
1 parent 80606d5 commit b71981f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mongodbforms/documents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def _post_clean(self):
356356
value = getattr(self.instance, f.name)
357357
if f.name not in exclude:
358358
f.validate(value)
359-
elif value == '':
359+
elif value == '' or value == []:
360360
# mongoengine chokes on empty strings for fields
361361
# that are not required. Clean them up here, though
362362
# this is maybe not the right place :-)

0 commit comments

Comments
 (0)