From c94c1a9202298504caf5f8bf3842e4f59d07bf33 Mon Sep 17 00:00:00 2001 From: SDE Date: Thu, 26 Dec 2024 16:54:39 +0300 Subject: [PATCH] 2.1.4 get_routes_Dict fix from\to city v2 --- RoutesApp/funcs.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/RoutesApp/funcs.py b/RoutesApp/funcs.py index 13f0bd1..58fe39a 100644 --- a/RoutesApp/funcs.py +++ b/RoutesApp/funcs.py @@ -301,24 +301,24 @@ def get_routes_Dict(user=None, data=None): try: - for route in routes: - - try: - - if route.type_transport == 'avia': - route.from_airport = Airport.objects.get(id=route.from_address_point) - route.to_airport = Airport.objects.get(id=route.to_address_point) - route.from_city = route.from_airport.city - route.to_city = route.to_airport.city - else: - route.from_city = City.objects.get(id=route.from_address_point) - route.to_city = City.objects.get(id=route.to_address_point) - - route.from_country = route.from_city.country - route.to_country = route.to_city.country - except Exception as e: - msg = f'get_routes_for_user get route Error = {str(e)}' - print(msg) + # for route in routes: + # + # try: + # + # if route.type_transport == 'avia': + # route.from_airport = Airport.objects.get(id=route.from_address_point) + # route.to_airport = Airport.objects.get(id=route.to_address_point) + # route.from_city = route.from_airport.city + # route.to_city = route.to_airport.city + # else: + # route.from_city = City.objects.get(id=route.from_address_point) + # route.to_city = City.objects.get(id=route.to_address_point) + # + # route.from_country = route.from_city.country + # route.to_country = route.to_city.country + # except Exception as e: + # msg = f'get_routes_for_user get route Error = {str(e)}' + # print(msg) res_Dict.update({ 'routes': routes,