Fix a big issue when determine if there is a new document or we need to update.
With this issue all fields were update always (not only modified fields)
This commit is contained in:
parent
aa8a991d20
commit
17fc9d1886
@ -366,7 +366,7 @@ class Document(six.with_metaclass(TopLevelDocumentMetaclass, BaseDocument)):
|
|||||||
if write_concern is None:
|
if write_concern is None:
|
||||||
write_concern = {}
|
write_concern = {}
|
||||||
|
|
||||||
doc_id = self.to_mongo(fields=['id'])
|
doc_id = self.to_mongo(fields=[self._meta['id_field']])
|
||||||
created = ('_id' not in doc_id or self._created or force_insert)
|
created = ('_id' not in doc_id or self._created or force_insert)
|
||||||
|
|
||||||
signals.pre_save_post_validation.send(self.__class__, document=self,
|
signals.pre_save_post_validation.send(self.__class__, document=self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user