diff --git a/competition/filters.py b/competition/filters.py index 9d0d104..48ab451 100644 --- a/competition/filters.py +++ b/competition/filters.py @@ -5,6 +5,8 @@ class UpcomingFilter(BooleanFilter): def filter(self, qs: BaseManager, value: bool): + if value is None: + return qs lookup_expr = 'gte' if value else 'lte' lookup = '__'.join([self.field_name, lookup_expr]) return qs.filter(**{lookup: now()})