mirror of https://github.com/jumpserver/jumpserver
parent
7887548174
commit
0de6c41406
|
@ -1,3 +1,4 @@
|
||||||
|
from django.db.transaction import atomic
|
||||||
from django.db.utils import IntegrityError
|
from django.db.utils import IntegrityError
|
||||||
|
|
||||||
from accounts.models import AccountTemplate, Account
|
from accounts.models import AccountTemplate, Account
|
||||||
|
@ -20,6 +21,7 @@ class AccountTemplateSerializer(BaseAccountSerializer):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# TODO 数据库访问的太多了 后期优化
|
# TODO 数据库访问的太多了 后期优化
|
||||||
|
@atomic()
|
||||||
def bulk_update_accounts(self, instance, diff):
|
def bulk_update_accounts(self, instance, diff):
|
||||||
accounts = Account.objects.filter(source_id=instance.id)
|
accounts = Account.objects.filter(source_id=instance.id)
|
||||||
if not accounts:
|
if not accounts:
|
||||||
|
|
Loading…
Reference in New Issue