From 5e0372fd9058f28a4e71739a003e8ae2ce8579b4 Mon Sep 17 00:00:00 2001 From: WJH <40563566+loveclever@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:16:56 +0800 Subject: [PATCH] improve ldap user login (#5714) --- seahub/base/accounts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seahub/base/accounts.py b/seahub/base/accounts.py index 34eb66dfdeb..1cdd0014aa5 100644 --- a/seahub/base/accounts.py +++ b/seahub/base/accounts.py @@ -46,7 +46,7 @@ from seahub.settings import ENABLE_LDAP, LDAP_USER_FIRST_NAME_ATTR, LDAP_USER_LAST_NAME_ATTR, \ LDAP_USER_NAME_REVERSE, LDAP_FILTER, LDAP_CONTACT_EMAIL_ATTR, LDAP_USER_ROLE_ATTR, \ - ACTIVATE_USER_WHEN_IMPORT, ENABLE_SASL, SASL_MECHANISM, SASL_AUTHC_ID_ATTR + ENABLE_SASL, SASL_MECHANISM, SASL_AUTHC_ID_ATTR LDAP_PROVIDER = getattr(settings, 'LDAP_PROVIDER', 'ldap') try: @@ -968,7 +968,7 @@ def authenticate(self, ldap_user=None, password=None): if not user: try: - user = User.objects.create_ldap_user(is_active=ACTIVATE_USER_WHEN_IMPORT) + user = User.objects.create_ldap_user(is_active=True) SocialAuthUser.objects.add(user.username, ldap_provider, login_attr) except Exception as e: logger.error(f'recreate ldap user failed. {e}')