ikraft/django-userswitch — pull request #9 by sbast (2014-07-07 11:53:26+00:00)
Title: Fix custom username handling with custom User model in Django 1.5 and up

Fixes for 2 cases:
– _username_ field may contain special characters that need to encoded first (like '+' in e-mail addresses).
– Django 1.5 and up allows to specify a field that will act as a _username_ when User model is customized (with User.USERNAME_FIELD) so it needs to be handled dynamically.

Tested in a few projects managed by Tivix.