From 7bf57c60fb561ad2e7ff5e3ead50647a7032339a Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 6 Jan 2021 11:43:39 -0800 Subject: [PATCH] Avoid throwing database error trying to fav unknown statuses --- bookwyrm/incoming.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bookwyrm/incoming.py b/bookwyrm/incoming.py index 5e42fe45a..920e99c5e 100644 --- a/bookwyrm/incoming.py +++ b/bookwyrm/incoming.py @@ -251,6 +251,9 @@ def handle_delete_status(activity): def handle_favorite(activity): ''' approval of your good good post ''' fav = activitypub.Like(**activity) + # we dont know this status, we don't care about this status + if not models.Status.objects.filter(remote_id=fav.object).exists(): + return fav = fav.to_model(models.Favorite) if fav.user.local: