2.1.15 change cargo_type and transport_type names

This commit is contained in:
SDE
2025-01-14 18:38:38 +03:00
parent 4b57ad3f8b
commit a40ae5d37d
5 changed files with 51 additions and 9 deletions

View File

@@ -1,3 +1,4 @@
import copy
import json
from copy import deepcopy
@@ -357,9 +358,9 @@ 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 = cargo_type_choices
cargo_types = copy.deepcopy(cargo_type_choices)
if data['type_transport'] in ['avia']:
cargo_types = cargo_types[1:]
cargo_types = cargo_types[:2] + cargo_types[3:]
return JsonResponse({'cargo_types': cargo_types})