Fix événements de lieux dans le passé

This commit is contained in:
Jean-Marie Favreau 2024-11-22 19:20:12 +01:00
parent b569464894
commit 4e1441a92f

View File

@ -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):