From 3ee12345ec5db6ef847e219c2b77e322d6ff4e73 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 2 Mar 2021 20:19:50 -0800 Subject: [PATCH] Fixes boost notification --- bookwyrm/models/status.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index ba9727f58..6bcd5d93d 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -294,14 +294,16 @@ class Boost(ActivityMixin, Status): if not self.boosted_status.user.local: return - notification_model = apps.get_model( - 'bookwyrm.Notification', require_ready=True) - notification_model.objects.create( - user=self.boosted_status.user, - related_status=self.boosted_status, - related_user=self.user, - notification_type='BOOST', - ) + if self.boosted_status.user.local and \ + self.boosted_status.user != self.user: + notification_model = apps.get_model( + 'bookwyrm.Notification', require_ready=True) + notification_model.objects.create( + user=self.boosted_status.user, + related_status=self.boosted_status, + related_user=self.user, + notification_type='BOOST', + ) def delete(self, *args, **kwargs): ''' delete and un-notify '''