fix-#620: saving document doesn't create new fields in existing collection

This commit is contained in:
DavidBord
2014-08-05 17:29:14 +03:00
parent e008919978
commit 1e6a3163af
2 changed files with 12 additions and 0 deletions

View File

@@ -651,6 +651,8 @@ class BaseDocument(object):
default = default()
if isinstance(default, BaseDocument):
changed_fields.append(field_name)
elif not only_fields or field_name in only_fields:
changed_fields.append(field_name)
if errors_dict:
errors = "\n".join(["%s - %s" % (k, v)