From 07de15c7953dc817322d51aae3d3098e1ca10b29 Mon Sep 17 00:00:00 2001 From: Sajeyks Date: Mon, 5 Oct 2026 22:46:47 +0300 Subject: [PATCH] Use plain Django login in dev when no LDAP server is configured --- dynamicweb/settings/local.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dynamicweb/settings/local.py b/dynamicweb/settings/local.py index c48a4a2b..28d49bb2 100644 --- a/dynamicweb/settings/local.py +++ b/dynamicweb/settings/local.py @@ -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)