Event list: Respect event date in "running" filter

This commit is contained in:
Raphael Michel
2020-07-03 17:46:41 +02:00
parent c52fdc95a7
commit f690d74be7

View File

@@ -723,10 +723,12 @@ class EventFilterForm(FilterForm):
elif fdata.get('status') == 'running':
qs = qs.filter(
live=True
).annotate(
p_end=Coalesce(F('presale_end'), F('date_to'), F('date_from'))
).filter(
Q(presale_start__isnull=True) | Q(presale_start__lte=now())
).filter(
Q(presale_end__isnull=True) | Q(presale_end__gte=now())
Q(p_end__gte=now())
)
elif fdata.get('status') == 'notlive':
qs = qs.filter(live=False)