complete cms setup

This commit is contained in:
bruks 2026-10-02 11:54:47 +01:00
commit 577fdd33c2
130 changed files with 245 additions and 178 deletions

View file

@ -1,13 +1,22 @@
import logging
from django.conf import settings
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:
def authenticate(self, request, username=None, password=None, **kwargs):
user = super().authenticate(
request=request,
username=username,
password=password,
**kwargs
)
if user and not settings.DEBUG:
user.create_ldap_account(password)
return user
return user