0.8.37 owner_type initial

This commit is contained in:
SDE
2023-12-07 18:35:06 +03:00
parent aff0b0fe98
commit 6a5331d8eb
2 changed files with 8 additions and 2 deletions

View File

@@ -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)

View File

@@ -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)}'})