My login is pretty much vanilla Web2py.  No changes to default.py
users.

In the model I have this:

comment = ''
if request.controller=='auth_user':
    comment = SPAN('Must be at least 12 characters in length',
                       _style='color:orange;'
                      )
db.define_table(
    auth.settings.table_user_name,
    Field('first_name', length=128, default=''),
    Field('middle_name', length=128, default=''),
    Field('last_name', length=128, default=''),
    Field('generation', length=128, default=''),
    Field('email', length=128, default='', unique=True,
         comment=email_comment), # required
    Field('password', 'password', length=128,            # required
          readable=False, label='Password',
          comment=comment),
         ),
    # .... blah blah  more details + required fields
)

custom_auth_table.password.requires = [
    IS_STRONG(min=12, max=128, upper=None, lower=None,
             number=None, special=None,), CRYPT()
]

If I set error_message to an empty string or None in the model,
attempting to log in with password 'foo' causes the error banner
to appear with "None" as the caption.  If I don't set error_message
I get the banner with the error message from IS_STRONG().

What am I doing wrong?  What can I do about this?

Reply via email to