Check that manually setting Sequence Field in DynamicDocument doesn't increment the counter

Fixes #2471
This commit is contained in:
Jussi Kauppila
2021-02-16 12:23:29 +02:00
parent af3d3b7ee6
commit 48b979599f
2 changed files with 23 additions and 1 deletions

View File

@@ -156,7 +156,7 @@ class BaseDocument:
# Handle dynamic data only if an initialised dynamic document
if self._dynamic and not self._dynamic_lock:
if not hasattr(self, name) and not name.startswith("_"):
if name not in self._fields_ordered and not name.startswith("_"):
DynamicField = _import_class("DynamicField")
field = DynamicField(db_field=name, null=True)
field.name = name