[web2py] Re: Delete space from users email in auth form

2018-11-26 Thread Константин Комков
Yes, it's work: def user(): if request.post_vars.email: request.post_vars.email = request.post_vars.email.strip() return dict(form=auth()) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.go

[web2py] Re: Delete space from users email in auth form

2018-11-26 Thread Val K
1. Oops, instead of request.vars it should be request.post_vars 2. As 1st validator try CLEANUP('\s') -- 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

[web2py] Re: Delete space from users email in auth form

2018-11-26 Thread Константин Комков
Today I tried both of variant: first in default.py def user(): if request.vars.email: request.vars.email = request.vars.email.lower().strip() return dict(form=auth()) don't work - "incorrect email" second, I don't sure that all right here in db.py def emailStrip(): form.vars.

[web2py] Re: Delete space from users email in auth form

2018-11-23 Thread Константин Комков
Thank you, I try to change it ) -- 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] Re: Delete space from users email in auth form

2018-11-23 Thread Val K
`onvalidation` is what happens *after *form validation is passed. You can add your validators to auth_user.email.requires (they should be first on the validators list ) or you can insert your formatters in user() controller, I mean: def user(): if request.vars.email: request.vars.

[web2py] Re: Delete space from users email in auth form

2018-11-22 Thread Константин Комков
I do like that: def email_to_lower(form): form.vars.email = form.vars.email.lower() form.vars.email = form.vars.email.strip() auth.settings.login_onvalidation = email_to_lower -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (So

[web2py] Re: Delete space from users email in auth form

2018-11-22 Thread Leonel Câmara
You can use auth.settings.login_onvalidation to strip the email string. -- 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