kstateome / django-cas

K-State's maintained version of django-cas
MIT License
112 stars 83 forks source link

Add support for User models with renamed `username` field. #79

Open gakhov opened 5 years ago

gakhov commented 5 years ago

Django supports having different field name for usernames. It's very common to use email as username, and the Django framework profived all nessesary features to do that in a convenient way, i.e. methods to set and access those fields without knowing their exact names.

This commit fixed the current user interaction in CAS client to use the mentioned above methods, as it recommended by Django core and implemented in their standard ModelBackend.