mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 11:31:08 +00:00
Don't try to delete nonexistant objects
This commit is contained in:
parent
addcc59d7f
commit
2f493336ad
1 changed files with 3 additions and 1 deletions
|
@ -40,7 +40,9 @@ class Delete(Verb):
|
|||
def action(self):
|
||||
""" find and delete the activity object """
|
||||
obj = self.object.to_model(save=False, allow_create=False)
|
||||
obj.delete()
|
||||
if obj:
|
||||
obj.delete()
|
||||
# if we can't find it, we don't need to delete it because we don't have it
|
||||
|
||||
|
||||
@dataclass(init=False)
|
||||
|
|
Loading…
Reference in a new issue