From e0b705efa6cf85383eeba8fc98cc65316907adbb Mon Sep 17 00:00:00 2001 From: Timofey Date: Tue, 27 May 2025 11:56:42 +0300 Subject: [PATCH] linter fixes --- backend/api/search/views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/api/search/views.py b/backend/api/search/views.py index 8a15759..c7ff029 100644 --- a/backend/api/search/views.py +++ b/backend/api/search/views.py @@ -1,4 +1,6 @@ from rest_framework import generics +from rest_framework.request import Request as DRFRequest +from typing import cast from routes.models import Route from .serializers import SearchRouteSerializer from api.utils.pagination import StandardResultsSetPagination @@ -41,6 +43,7 @@ class SearchRouteListView(generics.ListAPIView): pagination_class = StandardResultsSetPagination def get_queryset(self): + request = cast(DRFRequest, self.request) owner_type = self.kwargs.get('owner_type') # получаем маршрут из URL и разбиваем его на города @@ -58,8 +61,8 @@ class SearchRouteListView(generics.ListAPIView): from_city = to_city = None else: # если маршрут не указан в URL, берем из query params и декодируем - from_city = self.request.query_params.get('from', '') - to_city = self.request.query_params.get('to', '') + from_city = request.query_params.get('from', '') + to_city = request.query_params.get('to', '') # декодируем значения, если они закодированы if from_city: