diff --git a/bocal/settings_base.py b/bocal/settings_base.py index a5f217c..22ff30a 100644 --- a/bocal/settings_base.py +++ b/bocal/settings_base.py @@ -87,7 +87,7 @@ AUTH_PASSWORD_VALIDATORS = [ AUTHENTICATION_BACKENDS = [ 'django.contrib.auth.backends.ModelBackend', - 'django_cas_ng.backends.CASBackend', + 'mainsite.cas_backend.BOcalCASBackend', ] CAS_ADMIN_PREFIX = '/yaes5eiS' # we don't want CAS to take over /admin auth diff --git a/mainsite/cas_backend.py b/mainsite/cas_backend.py new file mode 100644 index 0000000..a9abe05 --- /dev/null +++ b/mainsite/cas_backend.py @@ -0,0 +1,7 @@ +from django_cas_ng.backends import CASBackend + + +class BOcalCASBackend(CASBackend): + # Partly from Robin Champenois's "ExperiENS". Thanks! + def clean_username(self, username): + return username.lower().strip()