Thanks, Bruce.

Tried that approach, but it still gave me the error div on the form,
though there was no message.

If the password is long enough, I get the standard login failed
message in flash.

If the password is too short, login gives me the red error banner,
even if it's blank.

On Mar 12, 3:06 pm, Bruce Wade <bruce.w...@gmail.com> wrote:
> error_message = '' and error_message = None are treated as the samething.
>
> Try:
> error_message = '  '
>
> Haven't tried but that may give you a black message like you want.
>
>
>
>
>
>
>
>
>
> On Mon, Mar 12, 2012 at 12:02 PM, Cliff <cjk...@gmail.com> wrote:
> > 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?
>
> --
> --
> Regards,
> Bruce 
> Wadehttp://ca.linkedin.com/in/brucelwadehttp://www.wadecybertech.comhttp://www.warplydesigned.comhttp://www.fitnessfriendsfinder.com

Reply via email to