unique=True is enforced by the database, not web2py, so it may be case 
sensitive depending the backend. Also, failures will result in a database 
error rather than a nice error message reported to the user in the UI. 
Instead, you should rely on validators to manage this:

Field('email', requires=[IS_EMAIL(), IS_LOWER(),
                         IS_NOT_IN_DB(db, 'auth_user.email', error_message=
auth.messages.email_taken)]

The IS_LOWER() validator converts the email address to lower case (which is 
how it will then be stored), which effectively makes the lookup case 
insensitive. Note, the above is exactly the set of validators you get on 
the default email field when auth.settings.email_case_sensitive=True.

Anthony

On Wednesday, November 4, 2015 at 12:39:34 PM UTC-5, arihant daga wrote:
>
> In custom auth table even if email field is set to unique=true, if user 
> inputs two different values different in case ex.( 'em...@gmail.com' and '
> em...@gmail.com' ) it will accepts both and will store both of them in 
> database. Hence enabling a user to signup with the same email id multiple 
> times with multiple usernames. 
>

-- 
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.

Reply via email to