1
0
Fork 1
mirror of https://github.com/bookwyrm-social/bookwyrm.git synced 2025-04-09 11:54:05 +00:00

Check if obj exists for updates

This commit is contained in:
Mouse Reeve 2021-04-16 15:17:55 -07:00
parent caa261f4bf
commit bd294cce83

View file

@ -58,7 +58,9 @@ class Update(Verb):
def action(self):
""" 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)