0.8.40 change profile validation
This commit is contained in:
@@ -4,6 +4,9 @@ def get_phone_valid_error(val):
|
|||||||
|
|
||||||
error_msg = _('Некорректные символы в номере телефона,<br> пример корректного ввода +7 925 8600100')
|
error_msg = _('Некорректные символы в номере телефона,<br> пример корректного ввода +7 925 8600100')
|
||||||
|
|
||||||
|
if not val:
|
||||||
|
return None
|
||||||
|
|
||||||
if len(val) < 10:
|
if len(val) < 10:
|
||||||
return error_msg
|
return error_msg
|
||||||
|
|
||||||
|
|||||||
@@ -78,8 +78,8 @@ def get_profile_new_route_page_html(request, data):
|
|||||||
if 'owner_type' in data:
|
if 'owner_type' in data:
|
||||||
form.initial['owner_type'] = data['owner_type']
|
form.initial['owner_type'] = data['owner_type']
|
||||||
|
|
||||||
if request.user and request.user.is_authenticated and request.user.profile and 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.profile.phone})
|
form.initial.update({'phone': request.user.user_profile.phone})
|
||||||
|
|
||||||
Dict = {
|
Dict = {
|
||||||
'form': form,
|
'form': form,
|
||||||
|
|||||||
Reference in New Issue
Block a user