From 6a5331d8eb9a30c06f0c1d4047e3e6bbc941f2d6 Mon Sep 17 00:00:00 2001 From: SDE Date: Thu, 7 Dec 2023 18:35:06 +0300 Subject: [PATCH] 0.8.37 owner_type initial --- AuthApp/funcs.py | 4 ++-- RoutesApp/funcs.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) 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)}'})