From 5a2f6bdfc9437e52c82894a9cddfaee2ec67274a Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Thu, 22 Jun 2023 21:36:19 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20ldap=20sync=E4=BB=BB=E5=8A=A1=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E6=97=B6=20=E5=85=88=E6=A3=80=E6=9F=A5=E5=8F=AF?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/settings/api/ldap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/settings/api/ldap.py b/apps/settings/api/ldap.py index 256d21d31..8c98f821f 100644 --- a/apps/settings/api/ldap.py +++ b/apps/settings/api/ldap.py @@ -10,7 +10,7 @@ from rest_framework.generics import CreateAPIView from rest_framework.views import Response, APIView from common.api import AsyncApiMixin -from common.utils import get_logger, is_uuid +from common.utils import get_logger from orgs.models import Organization from orgs.utils import current_org from users.models import User @@ -166,6 +166,9 @@ class LDAPUserListApi(generics.ListAPIView): sync_util = LDAPSyncUtil() # 还没有同步任务 if sync_util.task_no_start: + ok, msg = LDAPTestUtil().test_config() + if not ok: + return Response(data={'msg': msg}, status=400) # 任务外部设置 task running 状态 sync_util.set_task_status(sync_util.TASK_STATUS_IS_RUNNING) t = threading.Thread(target=sync_ldap_user)