From ea599d769559fb8728181eff8124e64c16acb102 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Thu, 27 Mar 2025 13:57:20 +0800 Subject: [PATCH] perf: Perm the template push account --- apps/perms/serializers/permission.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/perms/serializers/permission.py b/apps/perms/serializers/permission.py index 2cd16fbdb..821a260e7 100644 --- a/apps/perms/serializers/permission.py +++ b/apps/perms/serializers/permission.py @@ -132,6 +132,9 @@ class AssetPermissionSerializer(ResourceLabelsMixin, BulkOrgResourceModelSeriali def create_account_through_template(self, nodes, assets): if not self.template_accounts: return + if self.instance: + assets = assets or self.instance.assets.all() + nodes = nodes or self.instance.nodes.all() assets = self.get_all_assets(nodes, assets) self.create_accounts(assets)