diff --git a/program/filters.py b/program/filters.py index 3ec956d0e5f5ce61b380d0f4f55a9840536dd7a9..b218b426a36c6693c1ba7c0fdc93e575361f77cd 100644 --- a/program/filters.py +++ b/program/filters.py @@ -85,12 +85,14 @@ class ShowFilterSet(StaticFilterHelpTextMixin, filters.FilterSet): # Add limit for future? show_ids = ( models.Schedule.objects.filter( + # not "once" schedules with first_date in the past and last_date in the future Q( - rrule_id__gt=1, + rrule__freq__gt=0, first_date__lte=timezone.now(), last_date__gte=timezone.now(), ) - | Q(rrule_id=1, first_date__gte=timezone.now()) + # "once" schedules with first_date in the future + | Q(rrule__freq=0, first_date__gte=timezone.now()) ) .distinct() .values_list("show_id", flat=True)