From 8d3319717edf6ba00758199d5884ee790a4d583a Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:26:40 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=BC=80=E5=90=AF=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=90=8E=E8=BF=87=E6=BB=A4root=20administrat?= =?UTF-8?q?or=20(#10089)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/accounts/automations/change_secret/manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/accounts/automations/change_secret/manager.py b/apps/accounts/automations/change_secret/manager.py index 999fc2c75..7bad9e5f6 100644 --- a/apps/accounts/automations/change_secret/manager.py +++ b/apps/accounts/automations/change_secret/manager.py @@ -78,7 +78,9 @@ class ChangeSecretManager(AccountBasePlaybookManager): accounts = accounts.filter(secret_type=self.secret_type) if settings.CHANGE_AUTH_PLAN_SECURE_MODE_ENABLED: - accounts = accounts.filter(privileged=False) + accounts = accounts.filter(privileged=False).exclude( + username__in=['root', 'administrator'] + ) return accounts def host_callback(