Add utils app

This commit is contained in:
M.Ravi 2023-12-06 16:46:30 +05:30
commit 6a74124adf
24 changed files with 4235 additions and 0 deletions

13
utils/backend.py Executable file
View file

@ -0,0 +1,13 @@
import logging
from django.contrib.auth.backends import ModelBackend
logger = logging.getLogger(__name__)
class MyLDAPBackend(ModelBackend):
def authenticate(self, username=None, password=None, **kwargs):
user = super().authenticate(username, password, **kwargs)
if user:
user.create_ldap_account(password)
return user