1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-08-13 09:29:40 +02:00

View and Highlight Vieux people.

This commit is contained in:
Pierre-antoine Comby
2022-04-01 08:53:18 +02:00
parent 3633f66a87
commit 6443d64b69
3 changed files with 14 additions and 6 deletions

View File

@@ -223,12 +223,13 @@ class ActivityEntryView(LoginRequiredMixin, TemplateView):
# Keep only users that have a note
note_qs = note_qs.filter(note__noteuser__isnull=False)
# Keep only 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(),
)
if activity.activity_type.name != "Pot Vieux":
# Keep only 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(),
)
# Filter with permission backend
note_qs = note_qs.filter(PermissionBackend.filter_queryset(self.request, Alias, "view"))