0.8.40 change profile validation

This commit is contained in:
SDE
2023-12-15 15:46:46 +03:00
parent 65eccde487
commit 36fd9599af
2 changed files with 5 additions and 2 deletions

View File

@@ -4,6 +4,9 @@ def get_phone_valid_error(val):
error_msg = _('Некорректные символы в номере телефона,<br> пример корректного ввода +7 925 8600100')
if not val:
return None
if len(val) < 10:
return error_msg

View File

@@ -78,8 +78,8 @@ def get_profile_new_route_page_html(request, data):
if 'owner_type' in data:
form.initial['owner_type'] = data['owner_type']
if request.user and request.user.is_authenticated and request.user.profile and request.user.profile.phone:
form.initial.update({'phone': request.user.profile.phone})
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})
Dict = {
'form': form,