From ec6438e643c3ef0b0388c05c2fad5beed99fb4fe Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Mon, 18 Nov 2024 17:12:13 +0300 Subject: [PATCH] Use update strength and simplify check Signed-off-by: bcmmbaga --- management/server/policy.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/management/server/policy.go b/management/server/policy.go index 6dcb96316..693ae2872 100644 --- a/management/server/policy.go +++ b/management/server/policy.go @@ -435,7 +435,7 @@ func (am *DefaultAccountManager) DeletePolicy(ctx context.Context, accountID, po var updateAccountPeers bool err = am.Store.ExecuteInTransaction(ctx, func(transaction Store) error { - policy, err = transaction.GetPolicyByID(ctx, LockingStrengthShare, accountID, policyID) + policy, err = transaction.GetPolicyByID(ctx, LockingStrengthUpdate, accountID, policyID) if err != nil { return err } @@ -502,8 +502,6 @@ func arePolicyChangesAffectPeers(ctx context.Context, transaction Store, account if hasPeers { return true, nil } - - return anyGroupHasPeers(ctx, transaction, policy.AccountID, policy.ruleGroups()) } return anyGroupHasPeers(ctx, transaction, policy.AccountID, policy.ruleGroups())