From 9b0424ea5558501d48416a0983fd8917224e03a1 Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Mon, 21 Oct 2024 17:30:31 +0300 Subject: [PATCH] update account policy check before verifying policy status Signed-off-by: bcmmbaga --- management/server/policy.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/management/server/policy.go b/management/server/policy.go index cf695e5e2..055542430 100644 --- a/management/server/policy.go +++ b/management/server/policy.go @@ -461,15 +461,14 @@ func (am *DefaultAccountManager) savePolicy(account *Account, policyToSave *Poli } oldPolicy := account.Policies[policyIdx] + // Update the existing policy + account.Policies[policyIdx] = policyToSave + if !policyToSave.Enabled && !oldPolicy.Enabled { return false, nil } - updateAccountPeers := anyGroupHasPeers(account, oldPolicy.ruleGroups()) || anyGroupHasPeers(account, policyToSave.ruleGroups()) - // Update the existing policy - account.Policies[policyIdx] = policyToSave - return updateAccountPeers, nil }