forked from mirrors/bookwyrm
Don't allow data source to change the primary key of an object.
This commit is contained in:
parent
686d6328ae
commit
0b49d56707
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue