+2
-1
@@ -988,7 +988,8 @@ class AuthAPI(object):
|
||||
requires = [requires]
|
||||
requires = list(filter(lambda t: isinstance(t, CRYPT), requires))
|
||||
if requires:
|
||||
requires[0].min_length = 0
|
||||
requires[0] = CRYPT(**requires[0].__dict__) # Copy the existing CRYPT attributes
|
||||
requires[0].min_length = 0 # But do not enforce minimum length for the old password
|
||||
|
||||
old_password = kwargs.get('old_password', '')
|
||||
new_password = kwargs.get('new_password', '')
|
||||
|
||||
@@ -138,6 +138,9 @@ class TestAuthAPI(unittest.TestCase):
|
||||
self.assertTrue('new_password2' in result['errors'])
|
||||
result = self.auth.change_password(old_password='bart_password', new_password='1234', new_password2='1234')
|
||||
self.assertTrue('old_password' in result['errors'])
|
||||
# Test the default 4 min_length is enforced on change password
|
||||
result = self.auth.change_password(old_password='1234', new_password='123', new_password2='123')
|
||||
self.assertTrue('new_password' in result['errors'])
|
||||
|
||||
def test_verify_key(self):
|
||||
self.auth.settings.registration_requires_verification = True
|
||||
|
||||
+2
-1
@@ -3693,7 +3693,8 @@ class Auth(AuthAPI):
|
||||
requires = [requires]
|
||||
requires = list(filter(lambda t: isinstance(t, CRYPT), requires))
|
||||
if requires:
|
||||
requires[0].min_length = 0
|
||||
requires[0] = CRYPT(**requires[0].__dict__) # Copy the existing CRYPT attributes
|
||||
requires[0].min_length = 0 # But do not enforce minimum length for the old password
|
||||
form = SQLFORM.factory(
|
||||
Field('old_password', 'password', requires=requires,
|
||||
label=self.messages.old_password),
|
||||
|
||||
Reference in New Issue
Block a user