feat: 账号收集批量同步账号 (#10051)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2023-03-23 15:24:19 +08:00
committed by GitHub
parent d3170e4815
commit f6c5c35a2c
2 changed files with 25 additions and 20 deletions

View File

@@ -109,7 +109,7 @@ class AssetPermissionSerializer(BulkOrgResourceModelSerializer):
if condition in username_secret_type_dict:
continue
account_data = {key: getattr(template, key) for key in account_attribute}
account_data['name'] = f"{account_data['name']}-clone"
account_data['name'] = f"{account_data['name']}-{_('Account template')}"
need_create_accounts.append(Account(**{'asset_id': asset.id, **account_data}))
return Account.objects.bulk_create(need_create_accounts)