From c04bf4638f1eade57f670a71454e7f0598950df0 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 30 Jan 2022 08:51:14 -0800 Subject: [PATCH] Avoid duplicate emails --- bookwyrm/emailing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bookwyrm/emailing.py b/bookwyrm/emailing.py index efef12638..80aca071b 100644 --- a/bookwyrm/emailing.py +++ b/bookwyrm/emailing.py @@ -48,7 +48,9 @@ def moderation_report_email(report): data["reportee"] = report.user.localname or report.user.username data["report_link"] = report.remote_id - for admin in models.User.objects.filter(groups__name__in=["admin", "moderator"]): + for admin in models.User.objects.filter( + groups__name__in=["admin", "moderator"] + ).distinct(): data["user"] = admin.display_name send_email.delay(admin.email, *format_email("moderation_report", data))