From b0b653c1b17332377cafbe40a2f26a55b2894903 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sun, 24 Nov 2024 19:11:52 +0100 Subject: [PATCH] =?UTF-8?q?On=20ne=20montre=20que=20les=20=C3=A9v=C3=A9nem?= =?UTF-8?q?ents=20publics=20aux=20utilisateurs=20non=20connect=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 5e9b4db..5155e58 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -1677,7 +1677,7 @@ class PlaceDetailView(ListView): def get_queryset(self): self.place = get_object_or_404(Place, pk=self.kwargs["pk"]) - return Event.objects.filter(exact_location=self.place).filter( + return get_event_qs(self.request).filter(exact_location=self.place).filter( Q(other_versions__isnull=True) | Q(other_versions__representative=F('pk')) | Q(other_versions__representative__isnull=True)).filter(start_day__gte=datetime.now()).order_by("start_day") @@ -1693,7 +1693,7 @@ class PlaceDetailViewPast(PlaceDetailView): def get_queryset(self): self.place = get_object_or_404(Place, pk=self.kwargs["pk"]) self.past = True - return Event.objects.filter(exact_location=self.place).filter( + return get_event_qs(self.request).filter(exact_location=self.place).filter( Q(other_versions__isnull=True) | Q(other_versions__representative=F('pk')) | Q(other_versions__representative__isnull=True)).filter(start_day__lte=datetime.now()).order_by("-start_day") @@ -1955,7 +1955,7 @@ class TagDeleteView(PermissionRequiredMixin, DeleteView): def view_tag(request, t): paginator = Paginator( - Event.objects.filter(tags__contains=[t]).order_by( + get_event_qs(request).filter(tags__contains=[t]).order_by( "start_day", "start_time"), 10, )