Because it migrations involving uniqueness are tricky and this change may 
break existing applications. Moreover there are cases when people do not 
want the email to be unique, for example if they also have a username.

On Sunday, 10 February 2013 16:34:12 UTC-6, Yarin wrote:
>
> Agree that is should be caught by validation- but why not enforce 
> uniqueness on the DB as well to prevent data corruption in case the db gets 
> hit by another source/ edited manually/ etc. Why have DB-level constraints 
> if we don't use them in cases like this?  
>
> On Sun, Feb 10, 2013 at 11:31 AM, Anthony <abas...@gmail.com <javascript:>
> > wrote:
>
>> The code is here: 
>> http://code.google.com/p/web2py/source/browse/gluon/tools.py#1452
>>
>> Uniqueness is checked via the form validators rather than unique=True 
>> (which is enforced at the database level). The validators are more useful 
>> because they display a user friendly error message on the form rather than 
>> causing a database operational error and a 500 response.
>>
>> Anthony
>>
>>
>> On Sunday, February 10, 2013 11:11:39 AM UTC-5, Yarin wrote:
>>>
>>> Why are email/username fields not created with (unique=True) by default? 
>>> Since these fields are use to identify users, non-unique values would 
>>> clearly break auth.
>>>
>>> (Side note: where is the code for defining the default auth table fields 
>>> located?- can't find it anywhere)
>>>
>>  -- 
>>  
>> --- 
>> 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+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 

--- 
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/groups/opt_out.


Reply via email to