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)