2.1.10 split mover and customer forms
This commit is contained in:
@@ -22,6 +22,7 @@ def get_profile_new_route_page_html(request, data):
|
||||
'form': form
|
||||
}
|
||||
|
||||
tpl = None
|
||||
|
||||
try:
|
||||
|
||||
@@ -75,22 +76,18 @@ def get_profile_new_route_page_html(request, data):
|
||||
if 'type_transport' in data:
|
||||
form = routeForm_assign_choices_by_type_transport(form, data['type_transport'])
|
||||
|
||||
# form.fields['from_place'].choices = transfer_location_choices
|
||||
# form.fields['to_place'].choices = transfer_location_choices
|
||||
# form.fields['cargo_type'].choices = cargo_type_choices
|
||||
#
|
||||
# form.base_fields['from_place'].choices = transfer_location_choices
|
||||
# form.base_fields['to_place'].choices = transfer_location_choices
|
||||
# form.base_fields['cargo_type'].choices = cargo_type_choices
|
||||
|
||||
# form = CreateRouteForm(initial=data)
|
||||
|
||||
# if not form.is_valid():
|
||||
# pass
|
||||
|
||||
if 'owner_type' in data:
|
||||
form.initial['owner_type'] = data['owner_type']
|
||||
|
||||
if data['owner_type'] == 'mover':
|
||||
tpl = 'v2/blocks/b_make_mover_order.html'
|
||||
else:
|
||||
tpl = 'v2/blocks/b_make_poster_order.html'
|
||||
|
||||
Dict.update({'owner_type': data['owner_type']})
|
||||
|
||||
|
||||
if request.user and request.user.is_authenticated and request.user.user_profile and request.user.user_profile.phone:
|
||||
form.initial.update({'phone': request.user.user_profile.phone})
|
||||
|
||||
@@ -99,15 +96,13 @@ def get_profile_new_route_page_html(request, data):
|
||||
'errors_off': errors_off
|
||||
}
|
||||
|
||||
if 'owner_type' in data:
|
||||
Dict.update({'owner_type': data['owner_type']})
|
||||
|
||||
# print(form)
|
||||
except Exception as e:
|
||||
# form.errors.append({'__all__': f'Ошибка: {str(e)}'})
|
||||
print(str(e))
|
||||
|
||||
html = render_to_string('v2/blocks/b_make_poster_order.html', Dict, request=request)
|
||||
html = render_to_string(tpl, Dict, request=request)
|
||||
return html
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user