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

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]