From 9cdc3ebee64f7c46be06d9264328c522889cdaf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20G=C3=A9rard?= Date: Sun, 5 May 2019 23:37:12 +0200 Subject: [PATCH] Fix default write concern on save call that was overwriting connection wc --- docs/changelog.rst | 1 + mongoengine/document.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 356e2b65..80b92b81 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -12,6 +12,7 @@ Development - disconnect now clears `mongoengine.connection._connection_settings` - 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 +- Fix the default write concern of .save that was overwriting the connection write concern #568 - mongoengine now requires pymongo>=3.5 #2017 - Generate Unique Indices for SortedListField and EmbeddedDocumentListFields #2020 - connect() fails immediately when db name contains invalid characters #2031 #1718 diff --git a/mongoengine/document.py b/mongoengine/document.py index 753520c7..5ccedbfa 100644 --- a/mongoengine/document.py +++ b/mongoengine/document.py @@ -375,7 +375,7 @@ class Document(six.with_metaclass(TopLevelDocumentMetaclass, BaseDocument)): self.validate(clean=clean) if write_concern is None: - write_concern = {'w': 1} + write_concern = {} doc = self.to_mongo()