From 8de3668065f2ca2881fcb5b5b0abe15d983dc6f9 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 2 Jan 2024 19:24:27 -0800 Subject: [PATCH] Expands tests and fixes logic error in report recipients --- bookwyrm/models/report.py | 6 +++--- bookwyrm/templates/snippets/report_modal.html | 1 - bookwyrm/tests/models/test_report_model.py | 14 ++++++++++++++ bookwyrm/tests/views/admin/test_reports.py | 4 ++-- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/bookwyrm/models/report.py b/bookwyrm/models/report.py index a8a435781..988b65f4f 100644 --- a/bookwyrm/models/report.py +++ b/bookwyrm/models/report.py @@ -64,9 +64,9 @@ class Report(ActivityMixin, BookWyrmModel): def get_recipients(self, software=None): """Send this to the public inbox of the offending instance""" - if self.user.local: - return None - return [self.user.shared_inbox or self.user.inbox] + if self.reported_user.local: + return [] + return [self.reported_user.shared_inbox or self.reported_user.inbox] def get_remote_id(self): return f"https://{DOMAIN}/settings/reports/{self.id}" diff --git a/bookwyrm/templates/snippets/report_modal.html b/bookwyrm/templates/snippets/report_modal.html index 67a2d8cc6..b0e5925f6 100644 --- a/bookwyrm/templates/snippets/report_modal.html +++ b/bookwyrm/templates/snippets/report_modal.html @@ -44,7 +44,6 @@ {% else %} {% endif %} -