From 5d2a8e9b7969705f237f2a3b98a44cbc1fd9d113 Mon Sep 17 00:00:00 2001 From: quark Date: Mon, 9 Sep 2024 19:05:53 +0200 Subject: [PATCH] Update views.py (don't display forced blocked note, it's just temporary patch, we need to block these note in models too) --- apps/activity/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/activity/views.py b/apps/activity/views.py index 87c35ef0..d559255d 100644 --- a/apps/activity/views.py +++ b/apps/activity/views.py @@ -265,12 +265,11 @@ class ActivityEntryView(LoginRequiredMixin, SingleTableMixin, TemplateView): # Keep only users that have a note note_qs = note_qs.filter(note__noteuser__isnull=False) - # Keep only members + # Keep only valid members note_qs = note_qs.filter( note__noteuser__user__memberships__club=activity.attendees_club, note__noteuser__user__memberships__date_start__lte=timezone.now(), - note__noteuser__user__memberships__date_end__gte=timezone.now(), - ) + note__noteuser__user__memberships__date_end__gte=timezone.now()).exclude(note__inactivity_reason='forced') # Filter with permission backend note_qs = note_qs.filter(PermissionBackend.filter_queryset(self.request, Alias, "view"))