fix object reload with shard_key in meta
This commit is contained in:
parent
f27debe7f9
commit
d79ae30f31
1 changed files with 1 additions and 1 deletions
|
|
@ -840,7 +840,7 @@ class BaseDocument(object):
|
||||||
if hasattr(self, '_changed_fields'):
|
if hasattr(self, '_changed_fields'):
|
||||||
self._mark_as_changed(name)
|
self._mark_as_changed(name)
|
||||||
|
|
||||||
if not self._created and name in self._meta.get('shard_key', tuple()):
|
if not self._created and name in self._meta.get('shard_key', tuple()) and self._data[name] != value:
|
||||||
from queryset import OperationError
|
from queryset import OperationError
|
||||||
raise OperationError("Shard Keys are immutable. Tried to update %s" % name)
|
raise OperationError("Shard Keys are immutable. Tried to update %s" % name)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue