From d115b4216c678c5146cfd10fa982603ce92fd120 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 17 Dec 2012 08:50:08 -0600 Subject: [PATCH] fixed issue 1227, entropy check with IS_STRONG, thanks Clavin Sim --- VERSION | 2 +- gluon/sqlhtml.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 3f4c53dd..c9cb033d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.3.1 (2012-12-17 08:45:52) dev +Version 2.3.1 (2012-12-17 08:49:20) dev diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index f4263fa2..88ae6e74 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -468,8 +468,9 @@ class PasswordWidget(FormWidget): requires = [requires] is_strong = [r for r in requires if isinstance(r, IS_STRONG)] if is_strong: - output.append(SCRIPT("web2py_validate_entropy(jQuery('#%s'),%s);" - % (attr['_id'], is_strong[0].entropy))) + output.append(SCRIPT("web2py_validate_entropy(jQuery('#%s'),%s);" % ( + attr['_id'], is_strong[0].entropy + if is_strong[0].entropy else "null"))) # end entropy check return output