fixed is_crypt in tools, thanks Anthony

This commit is contained in:
mdipierro
2014-09-11 12:09:43 -05:00
parent c3478f660a
commit cef7202781
2 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.9.9-stable+timestamp.2014.09.10.08.26.15
Version 2.9.9-stable+timestamp.2014.09.11.12.09.36
+7 -4
View File
@@ -3191,11 +3191,14 @@ class Auth(object):
if log is DEFAULT:
log = self.messages['change_password_log']
passfield = self.settings.password_field
is_crypt = copy.copy([t for t in table_user[passfield].requires
if isinstance(t,CRYPT)][0])
is_crypt.min_length = 0
requires = table_user[passfield].requires
if not isinstance(requires,(list, tuple)):
requires = [requires]
requires = filter(lambda t:isinstance(t,CRYPT), requires)
if requires:
requires[0].min_length = 0
form = SQLFORM.factory(
Field('old_password', 'password', requires=[is_crypt],
Field('old_password', 'password', requires=requires,
label=self.messages.old_password),
Field('new_password', 'password',
label=self.messages.new_password,