Skip to content
Snippets Groups Projects
Verified Commit c1537aa6 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

fix: make filter_exclude_inactive and filter_surronding static

parent 706567c7
No related branches found
No related tags found
No related merge requests found
Pipeline #7468 passed
......@@ -162,7 +162,8 @@ class ScheduleFilterSet(filters.FilterSet):
help_text="Excludes all schedules that don’t have timeslots in the future.",
)
def filter_exclude_inactive(self, queryset: QuerySet, name: str, value: bool):
@staticmethod
def filter_exclude_inactive(queryset: QuerySet, _: str, value: bool):
if not value:
return queryset
return queryset.filter(
......@@ -213,7 +214,8 @@ class TimeSlotFilterSet(filters.FilterSet):
help_text="Return only timeslots that belong to the specified show(s).",
)
def filter_surrounding(self, queryset: QuerySet, name: str, value: datetime.datetime):
@staticmethod
def filter_surrounding(queryset: QuerySet, _: str, value: datetime.datetime):
nearest_timeslots_in_future = (
models.TimeSlot.objects.filter(start__gte=value)
.order_by("start")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment