mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-28 02:50:38 +00:00
Merge pull request #154 from cthulahoops/confusing_id_bug
Don't allow data source to change the primary key of an object.
This commit is contained in:
commit
26139f7201
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