Use plain Django login in dev when no LDAP server is configured

This commit is contained in:
sajeyks 2026-10-05 22:46:47 +03:00
commit 07de15c795

View file

@ -26,3 +26,11 @@ INSTALLED_APPS += (
# debug_toolbar seems to conflict with multisite (and djangocms_multisite)
# 'debug_toolbar'
)
# Without an LDAP server (e.g. the docker test stack) log in with plain Django
# authentication, otherwise every successful login fails creating the LDAP account
if not AUTH_LDAP_SERVER:
AUTHENTICATION_BACKENDS = tuple(
'django.contrib.auth.backends.ModelBackend'
if backend == 'utils.backend.MyLDAPBackend' else backend
for backend in AUTHENTICATION_BACKENDS)