From 4e1441a92f6d26b6fde342489e97d42f31a07c12 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Fri, 22 Nov 2024 19:20:12 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20=C3=A9v=C3=A9nements=20de=20lieux=20dans?= =?UTF-8?q?=20le=20pass=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/agenda_culturel/views.py b/src/agenda_culturel/views.py index 2692d5f..2dcf94e 100644 --- a/src/agenda_culturel/views.py +++ b/src/agenda_culturel/views.py @@ -1673,7 +1673,10 @@ 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(start_day__lte=datetime.now()).order_by("-start_day") + return Event.objects.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") def get_context_data(self, **kwargs):