Use get_username() for referencing to the username attribute.

I'm using a custom User model, where users identified only by email and password and I don't have user.username field. We need to use get_username() for proper handling of custom models. 
https://docs.djangoproject.com/en/dev/ref/contrib/auth/#django.contrib.auth.models.User.get_username

But this raises the minimum version of Django to 1.5.