Fix change handler for objects updated using F expressions.

This commit is contained in:
Tyson Clugg 2015-05-18 12:35:52 +10:00
parent ea440356a3
commit bd830a4aab

View file

@ -346,7 +346,9 @@ class Collection(APIMixin):
if exps:
# clone/update obj with values but only for the expression fields
obj = deepcopy(obj)
for name, val in self.model.objects.values(*exps).get(pk=obj.pk):
for name, val in self.model.objects.values(*exps).get(
pk=obj.pk,
).items():
setattr(obj, name, val)
# run serialization now all fields are "concrete" (not F expressions)