Skip to content

Commit

Permalink
Hack that fixes unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Furr committed Jul 12, 2018
1 parent b070e7d commit 825922a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mongoengine/base/datastructures.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,16 @@ def update(self, *args, **kwargs):
return super(BaseDict, self).update(*args, **kwargs)

def _mark_as_changed(self, key=None):
if hasattr(self._instance, '_mark_as_changed'):
if key:
self._instance._mark_as_changed('%s.%s' % (self._name, key))
else:
self._instance._mark_as_changed(self._name)
try:
if hasattr(self._instance, '_mark_as_changed'):
if key:
self._instance._mark_as_changed(
'%s.%s' % (self._name, key % len(self))
)
else:
self._instance._mark_as_changed(self._name)
except ReferenceError:
pass


class BaseList(list):
Expand Down

0 comments on commit 825922a

Please sign in to comment.