Skip to content

Commit

Permalink
Bugfix on DateRangeQuickSelectListFilter (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpro authored Aug 27, 2023
1 parent 3179223 commit e4ea6fa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rangefilter/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,11 @@ def _make_query_filter(self, request, validated_data):
query_params = super()._make_query_filter(request, validated_data)
date_value_gte = validated_data.get(self.lookup_kwarg_gte, None)
date_value_lte = validated_data.get(self.lookup_kwarg_lte, None)
date_value_isnull = validated_data.get(self.lookup_kwarg_isnull, None)
if self.field.null:
date_value_isnull = validated_data.get(self.lookup_kwarg_isnull, None)

if date_value_isnull is not None and not any([date_value_lte, date_value_gte]):
query_params[self.lookup_kwarg_isnull] = date_value_isnull
if date_value_isnull is not None and not any([date_value_lte, date_value_gte]):
query_params[self.lookup_kwarg_isnull] = date_value_isnull

return query_params

Expand Down

0 comments on commit e4ea6fa

Please sign in to comment.