It worked when I put the messages before define_tables. Thanks once again Anthony!
I still would like to change the message: *This email already has an account*. Also, for some reason the first name and last name are not remembered when there is an error in the registration form. Is it supposed to be like that? *{{ =form.custom.widget.first_name.update(_placeholder="Förnamn",_class="form-control") }}* Den lördagen den 20:e september 2014 kl. 20:14:16 UTC+2 skrev Anthony: > > > I've noticed I can automatically change the error message of invalid email >> with *auth.messages.invalid_email*. This however works only for* >> auth.login()* but NOT for auth.register(). >> > > Works for me. Please show your code (always a good idea). Make sure you > set the message before calling auth.define_tables. > > >> Also, is it possible to change the error message for the *too short* >> message in the password field of the registration form? I do not find this >> value in the auth.messages. >> > > We should probably add that (feel free to post an issue on Google Code). > For now, after auth.define_tables: > > db.auth_user.password.requires = [CRYPT(key=auth.settings.hmac_key, > min_length=auth.settings. > password_min_length, > error_message='Your custom > message')] > > Another option is to insert the IS_STRONG validator, which gives you more > control. It also has built-in error messages that vary depending on which > requirement(s) weren't met. > > db.auth_user.password.requires.insert(0, IS_STRONG()) > > Anthony > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.