2.1.16 change cargo_type and transport_type names
This commit is contained in:
@@ -174,7 +174,8 @@ def edit_route_ajax(request):
|
||||
route = Route.objects.get(id=data['route_id'])
|
||||
|
||||
form = RouteForm(instance=route)
|
||||
form = routeForm_assign_choices_by_type_transport(form, route.type_transport)
|
||||
form = get_cargo_types_by_type_transport(route.type_transport, form)
|
||||
# routeForm_assign_choices_by_type_transport(form, route.type_transport)
|
||||
|
||||
route_address_points_Dict = route.get_address_points()
|
||||
form.initial.update({
|
||||
@@ -358,9 +359,7 @@ def get_cargo_type_by_transport_type_ajax(request):
|
||||
if not data or not 'type_transport' in data:
|
||||
return JsonResponse({'html': 'недостаточно данных'}, status=400)
|
||||
|
||||
cargo_types = copy.deepcopy(cargo_type_choices)
|
||||
if data['type_transport'] in ['avia']:
|
||||
cargo_types = cargo_types[:2] + cargo_types[3:]
|
||||
cargo_types = get_cargo_types_by_type_transport(data['type_transport'])
|
||||
|
||||
return JsonResponse({'cargo_types': cargo_types})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user