Merge pull request #2043 from bagerard/fix_write_concern_in_save

Fix default write concern on save call that was overwriting connection WC
This commit is contained in:
erdenezul 2019-05-15 15:26:50 +02:00 committed by GitHub
commit ee85af34d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ Development
- disconnect now clears `mongoengine.connection._connection_settings` - disconnect now clears `mongoengine.connection._connection_settings`
- disconnect now clears the cached attribute `Document._collection` - disconnect now clears the cached attribute `Document._collection`
- POTENTIAL BREAKING CHANGE: Aggregate gives wrong results when used with a queryset having limit and skip #2029 - POTENTIAL BREAKING CHANGE: Aggregate gives wrong results when used with a queryset having limit and skip #2029
- Fix the default write concern of .save that was overwriting the connection write concern #568
- mongoengine now requires pymongo>=3.5 #2017 - mongoengine now requires pymongo>=3.5 #2017
- Generate Unique Indices for SortedListField and EmbeddedDocumentListFields #2020 - Generate Unique Indices for SortedListField and EmbeddedDocumentListFields #2020
- connect() fails immediately when db name contains invalid characters #2031 #1718 - connect() fails immediately when db name contains invalid characters #2031 #1718

View File

@ -375,7 +375,7 @@ class Document(six.with_metaclass(TopLevelDocumentMetaclass, BaseDocument)):
self.validate(clean=clean) self.validate(clean=clean)
if write_concern is None: if write_concern is None:
write_concern = {'w': 1} write_concern = {}
doc = self.to_mongo() doc = self.to_mongo()