mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-09-27 14:00:21 +00:00
Check if obj exists for updates
This commit is contained in:
parent
caa261f4bf
commit
bd294cce83
1 changed files with 3 additions and 1 deletions
|
@ -58,7 +58,9 @@ class Update(Verb):
|
||||||
|
|
||||||
def action(self):
|
def action(self):
|
||||||
""" update a model instance from the dataclass """
|
""" update a model instance from the dataclass """
|
||||||
self.object.to_model(allow_create=False)
|
obj = self.object
|
||||||
|
if obj:
|
||||||
|
self.object.to_model(allow_create=False)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(init=False)
|
@dataclass(init=False)
|
||||||
|
|
Loading…
Reference in a new issue