From dcb50a90f4981c5e3186629a9c1edfa9bf0d5fb9 Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sun, 15 Dec 2024 00:39:59 +0100 Subject: [PATCH] Fixnuty problem pri neuvedeni filtra (#479) --- 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()})