Merge pull request #1916 from liuq/master
Bug fix: pre_save_post_validation could, in principle, modify the document
This commit is contained in:
commit
45c86be402
@ -368,6 +368,8 @@ class Document(six.with_metaclass(TopLevelDocumentMetaclass, BaseDocument)):
|
|||||||
|
|
||||||
signals.pre_save_post_validation.send(self.__class__, document=self,
|
signals.pre_save_post_validation.send(self.__class__, document=self,
|
||||||
created=created, **signal_kwargs)
|
created=created, **signal_kwargs)
|
||||||
|
# it might be refreshed by the pre_save_post_validation hook, e.g., for etag generation
|
||||||
|
doc = self.to_mongo()
|
||||||
|
|
||||||
if self._meta.get('auto_create_index', True):
|
if self._meta.get('auto_create_index', True):
|
||||||
self.ensure_indexes()
|
self.ensure_indexes()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user