2.1.4 def create_or_change_route_ajax v2

This commit is contained in:
SDE
2024-12-26 16:37:39 +03:00
parent 6274190e09
commit 0a67a1bb04
5 changed files with 37 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ def search_cities_in_db(search_str):
for item in objs_wo_tz:
item.get_n_save_timezone()
res_data = City.objects.filter(id__in=ids).values(
'id', 'name', 'country__name', 'timezone', 'country__flag'
'id', 'name', 'country__name', 'timezone', 'country__flag', 'country__short_code'
)
return list(res_data)

View File

@@ -78,10 +78,11 @@ def get_address_point_ajax(request):
return JsonResponse(res_Dict)
except Exception as e:
msg = f'ошибка в запросе = {str(e)}'
print(msg)
errors_Dict = {
'errors': {
'all__': f'ошибка в запросе = {str(e)}'
'all__': msg
}
}
return JsonResponse(errors_Dict, status=400)