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
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
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.
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
`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.
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
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
7 matches
Mail list logo