diff --git a/AuthApp/funcs.py b/AuthApp/funcs.py index c2f226e..aa77bc8 100644 --- a/AuthApp/funcs.py +++ b/AuthApp/funcs.py @@ -18,10 +18,10 @@ def get_profile_page_content_html(request, page_name, data): return get_chat_page_content_html(request, data) elif page_name == 'create_route_for_customer': from RoutesApp.funcs import get_profile_new_route_page_html - return get_profile_new_route_page_html(request, {}) + return get_profile_new_route_page_html(request, {'owner_type': 'customer'}) elif page_name == 'create_route_for_mover': from RoutesApp.funcs import get_profile_new_route_page_html - return get_profile_new_route_page_html(request, {}) + return get_profile_new_route_page_html(request, {'owner_type': 'mover'}) elif page_name == 'my_routes': from RoutesApp.funcs import get_profile_my_routes_page_content_html return get_profile_my_routes_page_content_html(request) diff --git a/RoutesApp/funcs.py b/RoutesApp/funcs.py index 34ceecc..dce7fd4 100644 --- a/RoutesApp/funcs.py +++ b/RoutesApp/funcs.py @@ -75,11 +75,17 @@ def get_profile_new_route_page_html(request, data): # if not form.is_valid(): # pass + if 'owner_type' in data: + form.initial['owner_type'] = data['owner_type'] + Dict = { 'form': form, '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)}'})