From 339d872d37ad03637840bf8ead5fa6bda429f33d Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 3 Apr 2023 16:52:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20LDAP=20=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E7=94=A8=E6=88=B7=E6=97=B6=E6=8C=87=E5=AE=9A=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E7=BB=84=E7=BB=87=EF=BC=8C=E8=BF=98=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=88=B0=20Default=20=E7=BB=84=E7=BB=87=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/settings/tasks/ldap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/settings/tasks/ldap.py b/apps/settings/tasks/ldap.py index 226a8139c..509ef8c6c 100644 --- a/apps/settings/tasks/ldap.py +++ b/apps/settings/tasks/ldap.py @@ -1,9 +1,9 @@ # coding: utf-8 -# +# from celery import shared_task from django.conf import settings from django.utils.translation import ugettext_lazy as _ - +from django.db import transaction from common.utils import get_logger from ops.celery.decorator import after_app_ready_start from ops.celery.utils import ( @@ -22,6 +22,7 @@ def sync_ldap_user(): @shared_task(verbose_name=_('Import ldap user')) +@transaction.atomic def import_ldap_user(): logger.info("Start import ldap user task") util_server = LDAPServerUtil()