Okay, I've thought more about this and can see why you might want to overwrite the validators...you don't want IS_NOT_IN_DB(db, auth_table.email) validation on login! So maybe just a case-sensitive flag?
On Apr 26, 12:01 pm, Russell <russell.mcmur...@gmail.com> wrote: > Hi, > > Auth.login overwrites any custom email validators that you define. > Specifically, line 1019 of tools.py overwrites > table_user[username].requires with > IS_EMAIL(error_message=self.messages.invalid_email). Why is this > necessary? For example, it means that this does NOT work: > > db.py > ----- > auth_table = db.define_table( > auth.settings.table_user_name, > Field('email', length=128, default='', > unique=True, writable=True), > ...) > > auth_table.email.requires = [ > IS_LOWER(), > IS_EMAIL(error_message=auth.messages.invalid_email)] > > Email must be case-sensitive?! Anyway, I suggest the following patch > to tools.py: > > Replace: > 1019 table_user[username].requires = tmpvalidator > With: > 1019 table_user[username].requires = table_user[username].requires or > tmpvalidator > > Or if you consider this a feature, perhaps a new setting? > 1019 if not self.settings.login_email_custom_validators: > table_user[username].requires = tmpvalidator > > Thanks > Russell > > -- > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en