Fixes error when receiving Undo for unknown boost
This commit is contained in:
parent
848edd2972
commit
2548ba926a
2 changed files with 20 additions and 0 deletions
|
@ -70,6 +70,9 @@ class Undo(Verb):
|
|||
if self.object.type == "Follow":
|
||||
model = apps.get_model("bookwyrm.UserFollows")
|
||||
obj = self.object.to_model(model=model, save=False, allow_create=False)
|
||||
if not obj:
|
||||
# if we don't have the object, we can't undo it. happens a lot with boosts
|
||||
return
|
||||
obj.delete()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue