From 15427fb743fd2f04702306796bb6e4a85a3dee37 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 14 Mar 2018 19:37:36 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E8=BF=98=E5=8E=9Fldap=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/models.py | 2 +- apps/jumpserver/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/common/models.py b/apps/common/models.py index 93675404f..1f634bce2 100644 --- a/apps/common/models.py +++ b/apps/common/models.py @@ -67,7 +67,7 @@ class Setting(models.Model): if self.name == "AUTH_LDAP": if self.cleaned_value and settings.AUTH_LDAP_BACKEND not in settings.AUTHENTICATION_BACKENDS: - settings.AUTHENTICATION_BACKENDS.append(settings.AUTH_LDAP_BACKEND) + settings.AUTHENTICATION_BACKENDS.insert(0, settings.AUTH_LDAP_BACKEND) elif not self.cleaned_value and settings.AUTH_LDAP_BACKEND in settings.AUTHENTICATION_BACKENDS: settings.AUTHENTICATION_BACKENDS.remove(settings.AUTH_LDAP_BACKEND) diff --git a/apps/jumpserver/settings.py b/apps/jumpserver/settings.py index 0cc200f7d..6fa15e1df 100644 --- a/apps/jumpserver/settings.py +++ b/apps/jumpserver/settings.py @@ -332,7 +332,7 @@ AUTH_LDAP_ALWAYS_UPDATE_USER = True AUTH_LDAP_BACKEND = 'django_auth_ldap.backend.LDAPBackend' if AUTH_LDAP: - AUTHENTICATION_BACKENDS.append(AUTH_LDAP_BACKEND) + AUTHENTICATION_BACKENDS.insert(0, AUTH_LDAP_BACKEND) # Celery using redis as broker CELERY_BROKER_URL = 'redis://:%(password)s@%(host)s:%(port)s/3' % {