From 397394127c95e93ab04dce20eb5f58d7ad16a5d4 Mon Sep 17 00:00:00 2001 From: mattiagiupponi <51856725+mattiagiupponi@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:52:15 +0200 Subject: [PATCH] =?UTF-8?q?[Fixes=20#12596]=20User=20with=20notification?= =?UTF-8?q?=20disabled=20still=20receive=20the=20noti=E2=80=A6=20(#12597)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Fixes #12596] User with notification disabled still receive the notifications * [Fixes #12596] User with notification disabled still receive the notifications --- geonode/notifications_helper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geonode/notifications_helper.py b/geonode/notifications_helper.py index fa850f34a76..0ee0a1a1981 100644 --- a/geonode/notifications_helper.py +++ b/geonode/notifications_helper.py @@ -111,9 +111,9 @@ def get_notification_recipients(notice_type_label, exclude_user=None, resource=N """Get notification recipients""" if not has_notifications: return [] - recipients_ids = notifications.models.NoticeSetting.objects.filter(notice_type__label=notice_type_label).values( - "user" - ) + recipients_ids = notifications.models.NoticeSetting.objects.filter( + notice_type__label=notice_type_label, send=True + ).values("user") profiles = get_user_model().objects.filter(id__in=recipients_ids) exclude_users_ids = []