Hello,

User are allow to enter noting when they change their password in
application/user/change_password form, I can also create user without
password in appadmin even if I set requires=is_not_empty() in the
model of auth_user table.

# Here my model definition :
auth_table = db.define_table(
    auth.settings.table_user_name,
    Field('first_name', length=128, default=None,
        required=True,
        notnull=True,
        requires =
IS_NOT_EMPTY(error_message=T(auth.messages.is_empty)),
        ),
    Field('last_name', length=128, default=None,
        requires =
IS_NOT_EMPTY(error_message=T(auth.messages.is_empty)),
        ),
    Field('email', length=128, default=None, unique=True,
label=T('Email'),
        requires =
[IS_EMAIL(error_message=T(auth.messages.invalid_email)),
            IS_NOT_IN_DB(db, 'auth_user.email')],
        ),
    Field('password', 'password', length=256,
          readable=False, label=T('Password'),
          required=True,
          notnull=True,
          requires = [CRYPT(),
IS_NOT_EMPTY(error_message=T(auth.messages.is_empty))]
          ),
    Field('registration_key', length=128, default=None,
          writable=False, readable=False),
    Field('reset_password_key', length=512,
        writable=False, readable=False, default=None
        ),
    migrate=False,
    format='%(first_name)s %(last_name)s (%(id)s)')

OK, just find that IS_NOT_EMPTY() not works except if it is before the
CRYPT() :

requires = [IS_NOT_EMPTY(error_message=T(auth.messages.is_empty)),
CRYPT()]

I think this is a bug...

I use web2py 1.99.4

Richard

Reply via email to