From 24d277c499b380cb03c6b5d4168b8d41fc164fff Mon Sep 17 00:00:00 2001 From: Timofey Date: Mon, 26 May 2025 17:38:56 +0300 Subject: [PATCH] use requests via cast as drf requires --- backend/api/search/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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()