Skip to content

Commit

Permalink
Fixnuty problem pri neuvedeni filtra (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacspe authored Dec 14, 2024
1 parent 4c96ee1 commit dcb50a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions competition/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()})

0 comments on commit dcb50a9

Please sign in to comment.