diff --git a/backend/api/search/views.py b/backend/api/search/views.py index a639fb7..e131045 100644 --- a/backend/api/search/views.py +++ b/backend/api/search/views.py @@ -1,4 +1,6 @@ from rest_framework import generics +from typing import cast +from rest_framework.request import Request from routes.models import Route from .serializers import SearchRouteSerializer from api.utils.pagination import StandardResultsSetPagination @@ -12,8 +14,8 @@ class SearchRouteListView(generics.ListAPIView): def get_queryset(self): owner_type = self.kwargs.get('owner_type') - from_city = self.request.query_params.get('from') - to_city = self.request.query_params.get('to') + from_city = cast(Request, self.request).query_params.get('from') + to_city = cast(Request, self.request).query_params.get('to') valid_types = [choice[0] for choice in owner_type_choices] current_time = timezone.now()