perf: Sync account privileged

This commit is contained in:
feng
2026-01-07 15:30:29 +08:00
committed by ZhaoJiSen
parent 8f75a5677c
commit 1e085029dc

View File

@@ -33,6 +33,7 @@ def template_sync_related_accounts(template_id, user_id=None):
name = template.name
username = template.username
secret_type = template.secret_type
privileged = template.privileged
print(
f'\033[32m>>> 开始同步模板名称、用户名、密钥类型到相关联的账号 ({datetime.now().strftime("%Y-%m-%d %H:%M:%S")})')
with tmp_to_org(org_id):
@@ -40,8 +41,9 @@ def template_sync_related_accounts(template_id, user_id=None):
account.name = name
account.username = username
account.secret_type = secret_type
account.privileged = privileged
try:
account.save(update_fields=['name', 'username', 'secret_type'])
account.save(update_fields=['name', 'username', 'secret_type', 'privileged'])
succeeded += 1
succeeded_account_ids.append(account.id)
except Exception as e: