Fixes boost notification

This commit is contained in:
Mouse Reeve 2021-03-02 20:19:50 -08:00
parent be3c7ac90e
commit 3ee12345ec

View file

@ -294,14 +294,16 @@ class Boost(ActivityMixin, Status):
if not self.boosted_status.user.local: if not self.boosted_status.user.local:
return return
notification_model = apps.get_model( if self.boosted_status.user.local and \
'bookwyrm.Notification', require_ready=True) self.boosted_status.user != self.user:
notification_model.objects.create( notification_model = apps.get_model(
user=self.boosted_status.user, 'bookwyrm.Notification', require_ready=True)
related_status=self.boosted_status, notification_model.objects.create(
related_user=self.user, user=self.boosted_status.user,
notification_type='BOOST', related_status=self.boosted_status,
) related_user=self.user,
notification_type='BOOST',
)
def delete(self, *args, **kwargs): def delete(self, *args, **kwargs):
''' delete and un-notify ''' ''' delete and un-notify '''