|
|
|
@ -315,6 +315,8 @@ class ResetRequest(View):
|
|
|
|
|
return render(request, 'error.html', { 'service': service, 'error': 'Please supply a password and confirm it.' } ) |
|
|
|
|
if password1 != password2: |
|
|
|
|
return render(request, 'error.html', { 'service': service, 'error': 'The supplied passwords do not match.' } ) |
|
|
|
|
if len(password1) < 8: |
|
|
|
|
return render(request, 'error.html', { 'service': service, 'error': 'The password is too short, please use a longer one. At least 8 characters.' } ) |
|
|
|
|
# everything checks out, now change the password |
|
|
|
|
with get_pool().next() as rpc: |
|
|
|
|
pwd = r'%s' % password1 |
|
|
|
@ -371,6 +373,10 @@ class ChangePassword(View):
|
|
|
|
|
if password1 != password2: |
|
|
|
|
return render(request, 'error.html', { 'urlname': urlname, 'service': service, |
|
|
|
|
'error': 'Please check if you typed the same password both times for the new password' } ) |
|
|
|
|
# Check for password length |
|
|
|
|
if len(password1) < 8: |
|
|
|
|
return render(request, 'error.html', { 'urlname': urlname, 'service': service, |
|
|
|
|
'error': 'The password is too short, please use a longer one. At least 8 characters.' } ) |
|
|
|
|
with get_pool().next() as rpc: |
|
|
|
|
# Trying to change the password |
|
|
|
|
pwd = r'%s' % password1 |
|
|
|
|