Re: Case-insensitive email as username

2015-11-24 Thread Carl Meyer
On 11/24/2015 04:33 AM, Aymeric Augustin wrote: > 2015-11-23 23:52 GMT+01:00 Carl Meyer >: > > I've implemented the CITEXT-based solution a couple times; I think for a > PostgreSQL-based project it's the preferable option overall. > > Perhaps

Re: Case-insensitive email as username

2015-11-24 Thread Chris Foresman
We usually just handle this with a custom serializer (or form) field that converts all input to lowercase. That way we don't have to change any lookups or anything; all emails that come in to the system are already lowercase. Of course, that doesn't preserve what users enter but IME anything

Re: Case-insensitive email as username

2015-11-24 Thread Aymeric Augustin
2015-11-23 23:52 GMT+01:00 Carl Meyer : I've implemented the CITEXT-based solution a couple times; I think for a > PostgreSQL-based project it's the preferable option overall. > Perhaps we should add native support in contrib.postgres? I'm forseeing a small difficulty in terms

Re: Case-insensitive email as username

2015-11-23 Thread Podrigal, Aron
Why not creating the index as LOWER(email) and do the lookup as LOWER? On Nov 23, 2015 6:18 PM, "Carl Meyer" wrote: > On 11/23/2015 03:52 PM, Carl Meyer wrote: > ... > > I suppose the best we could do to ease this would be to add a > > CreateExtension migration operation in

Re: Case-insensitive email as username

2015-11-23 Thread Carl Meyer
On 11/23/2015 03:52 PM, Carl Meyer wrote: ... > I suppose the best we could do to ease this would be to add a > CreateExtension migration operation in contrib.postgres that, if lacking > super-user permissions, simply errors out and tells you what SQL you > need to run manually as a super-user?

Re: Case-insensitive email as username

2015-11-23 Thread Carl Meyer
Hi Aymeric, On 11/22/2015 11:56 AM, Aymeric Augustin wrote: > I spent a good part of today implementing what must be the most common > scenario for custom user models: case-insensitive email as username. > (Yes. This horse has been beaten to death. Multiple times.) > > Since i

Case-insensitive email as username

2015-11-22 Thread Aymeric Augustin
Hello, I spent a good part of today implementing what must be the most common scenario for custom user models: case-insensitive email as username. (Yes. This horse has been beaten to death. Multiple times.) Since it was the first time I implemented a custom user model from scratch by myself