diff --git a/VERSION b/VERSION index 90dd25e9..0153a229 100644 --- a/VERSION +++ b/VERSION @@ -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 diff --git a/gluon/tools.py b/gluon/tools.py index fc63da2f..b7f4abc6 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -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,