aboutsummaryrefslogtreecommitdiffstats
path: root/modules/django_application/files/custom_backend.py
blob: 828744fbaaf18382ebbeee1d57d98e98da4428a7 (plain)
1
2
3
4
5
6
7
8
9

from django_auth_ldap.backend import LDAPBackend,_LDAPUser 

class ForceUidLDAPBackend(LDAPBackend):
    def ldap_to_django_username(self, username):
        # force uid if someone give a email
        return _LDAPUser(self, username=username).attrs['uid'][0]