mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-24 03:06:38 +00:00
Fix failed to create policy and delete user PAT on postgres
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
@@ -399,7 +399,12 @@ func (am *DefaultAccountManager) SavePolicy(ctx context.Context, accountID, user
|
||||
return fmt.Errorf("failed to increment network serial: %w", err)
|
||||
}
|
||||
|
||||
if err = transaction.SavePolicy(ctx, LockingStrengthUpdate, policy); err != nil {
|
||||
saveFunc := transaction.SavePolicy
|
||||
if !isUpdate {
|
||||
saveFunc = transaction.CreatePolicy
|
||||
}
|
||||
|
||||
if err := saveFunc(ctx, LockingStrengthUpdate, policy); err != nil {
|
||||
return fmt.Errorf("failed to save policy: %w", err)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user