Don't allow data source to change the primary key of an object.

This commit is contained in:
Adam Kelly 2020-04-26 15:59:02 +01:00
parent 686d6328ae
commit 0b49d56707

View file

@ -70,6 +70,9 @@ def update_from_mappings(obj, data, mappings):
if not formatter:
formatter = noop
if key == 'id':
continue
if has_attr(obj, key):
obj.__setattr__(key, formatter(value))
return obj