mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-25 16:51:00 +00:00
Don't worry about interactions on dead posts
This commit is contained in:
parent
da3c0d5bbf
commit
bfe015ebd8
1 changed files with 7 additions and 2 deletions
|
@ -281,7 +281,12 @@ class PostInteraction(StatorModel):
|
|||
"""
|
||||
with transaction.atomic():
|
||||
# Create it
|
||||
interaction = cls.by_ap(data, create=True)
|
||||
try:
|
||||
interaction = cls.by_ap(data, create=True)
|
||||
except (cls.DoesNotExist, Post.DoesNotExist):
|
||||
# That post is gone, boss
|
||||
# TODO: Limited retry state?
|
||||
return
|
||||
# Boosts (announces) go to everyone who follows locally
|
||||
if interaction.type == cls.Types.boost:
|
||||
for follow in Follow.objects.filter(
|
||||
|
@ -303,7 +308,7 @@ class PostInteraction(StatorModel):
|
|||
# Find it
|
||||
try:
|
||||
interaction = cls.by_ap(data["object"])
|
||||
except cls.DoesNotExist:
|
||||
except (cls.DoesNotExist, Post.DoesNotExist):
|
||||
# Well I guess we don't need to undo it do we
|
||||
return
|
||||
# Verify the actor matches
|
||||
|
|
Loading…
Reference in a new issue