From e2fe064ea03c02d9bc6e9c244159cb5310b3f04a Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:56:37 +0200 Subject: [PATCH] NumericRangeFilter: Fix filter for the value zero (#105) --- rangefilter/filters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rangefilter/filters.py b/rangefilter/filters.py index 38bd935..4c3b1e3 100644 --- a/rangefilter/filters.py +++ b/rangefilter/filters.py @@ -344,9 +344,9 @@ def _make_query_filter(self, _request, validated_data): value_gte = validated_data.get(self.lookup_kwarg_gte, None) value_lte = validated_data.get(self.lookup_kwarg_lte, None) - if value_gte: + if value_gte is not None: query_params["{0}__gte".format(self.field_path)] = value_gte - if value_lte: + if value_lte is not None: query_params["{0}__lte".format(self.field_path)] = value_lte return query_params