In trunk, login not uses auth.messages.is_empty
so you can use internationalizaiton and/or change the error message. On Dec 2, 1:07 am, "hamdy.a.farag" <[email protected]> wrote: > Hi > > I got a problem using the sign in form > > I got the email field and password field > > Now email field is not validated as expected , when letting it empty I > got the error message > "enter a value" which I can't translate . > > if I entered any characters in it I got nothing > > looking into Auth() in the login() function I found > > def login( > ...... > > table_user = self.settings.table_user > if 'username' in table_user.fields: > username = 'username' > else: > username = 'email' > old_requires = table_user[username].requires > table_user[username].requires = IS_NOT_EMPTY() > > Now we've only one validator on the field which is IS_NOT_EMPTY() > > Now I want to things to happen and I don't know how > > 1 - add validation IS_EMAIL() on the email field > 2- be able to translate the error messages in both cases (if field is > empty or not an email) > > note: > > IN MY MODEL , I've : > > auth.settings.table_user.email.requires = [IS_NOT_EMPTY(error_message > = T("Enter value")), IS_EMAIL(error_message=T("Enter Email")), > IS_NOT_IN_DB(db, > auth.settings.table_user.email, error_message=T("value already in > database"))] > > but this seems to be not working -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.

