omab/django-social-auth — pull request #610 by topiaruss (2013-02-20 12:20:25+00:00)
Title: make user detection by email address case-insensitive

Problem:: email address with different case causing a duplicate auth_users entry, which led to the following error on /login/

"MultipleObjectsReturned: get() returned more than one User -- it returned 2! Lookup parameters were {'email': u'auser@msn.com'}"

Of the two entries, one from fb, the other an email/password login, one was auser@msn, the other was Auser@msn.

Solution:: make the matching in association and base be case-insensitive.

Due-Diligence:: Google "django email__iexact=email" to see that several others have already crossed this bridge before.

Note:: I add a TODO in simple_user_exists, since I believe the same problem might occur there, depending how it's used.