From b5fc6aa5ed344092b27a8fc795948d306faecfe2 Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sun, 15 Dec 2024 00:08:05 +0100 Subject: [PATCH] Fixnuty problem pri neuvedeni filtra --- competition/filters.py | 2 ++ 1 file changed, 2 insertions(+) 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()})