[management] Delete service users with account manager (#3793)

This commit is contained in:
Bethuel Mmbaga
2025-05-06 18:31:03 +03:00
committed by GitHub
parent ac135ab11d
commit ebda0fc538
2 changed files with 50 additions and 2 deletions

View File

@@ -603,11 +603,15 @@ func (am *DefaultAccountManager) DeleteAccount(ctx context.Context, accountID, u
}
for _, otherUser := range account.Users {
if otherUser.IsServiceUser {
if otherUser.Id == userID {
continue
}
if otherUser.Id == userID {
if otherUser.IsServiceUser {
err = am.deleteServiceUser(ctx, accountID, userID, otherUser)
if err != nil {
return err
}
continue
}