From be3c7ac90e09c61eb98fa991b5f942561eb8c936 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 2 Mar 2021 20:17:32 -0800 Subject: [PATCH 1/3] Fixes boost display --- bookwyrm/templates/snippets/status/status.html | 2 +- bookwyrm/templates/snippets/status/status_content.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bookwyrm/templates/snippets/status/status.html b/bookwyrm/templates/snippets/status/status.html index b8925f183..e9ef13805 100644 --- a/bookwyrm/templates/snippets/status/status.html +++ b/bookwyrm/templates/snippets/status/status.html @@ -1,7 +1,7 @@ {% load bookwyrm_tags %} {% load i18n %} {% if not status.deleted %} - {% if status.status_type == 'Boost' %} + {% if status.status_type == 'Announce' %} {% include 'snippets/avatar.html' with user=status.user %} {% include 'snippets/username.html' with user=status.user %} {% trans "boosted" %} diff --git a/bookwyrm/templates/snippets/status/status_content.html b/bookwyrm/templates/snippets/status/status_content.html index bdbf3cfcc..d16c6922b 100644 --- a/bookwyrm/templates/snippets/status/status_content.html +++ b/bookwyrm/templates/snippets/status/status_content.html @@ -32,7 +32,7 @@ {% endif %} - {% if status.content and status.status_type != 'GeneratedNote' and status.status_type != 'Boost' %} + {% if status.content and status.status_type != 'GeneratedNote' and status.status_type != 'Announce' %} {% include 'snippets/trimmed_text.html' with full=status.content|safe %} {% endif %} {% if status.attachments %} From 3ee12345ec5db6ef847e219c2b77e322d6ff4e73 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 2 Mar 2021 20:19:50 -0800 Subject: [PATCH 2/3] 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 ''' From 51cf580813894213f55f404297bfc260120c2550 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 2 Mar 2021 20:24:51 -0800 Subject: [PATCH 3/3] Revert "Fixes boost notification" This reverts commit 3ee12345ec5db6ef847e219c2b77e322d6ff4e73. --- bookwyrm/models/status.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index 6bcd5d93d..ba9727f58 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -294,16 +294,14 @@ class Boost(ActivityMixin, Status): if not self.boosted_status.user.local: return - 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', - ) + 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 '''