Remove group bans on user deletion

This commit is contained in:
Loporrit
2024-03-14 18:50:35 +00:00
parent b2e4b99b10
commit be1edba5c2
2 changed files with 6 additions and 0 deletions

View File

@@ -100,6 +100,10 @@ public static class SharedDbFunctions
await dbContext.SaveChangesAsync().ConfigureAwait(false);
}
var bannedinGroups = await dbContext.GroupBans.Where(u => u.BannedUserUID == user.UID).ToListAsync().ConfigureAwait(false);
dbContext.GroupBans.RemoveRange(bannedinGroups);
_logger.LogInformation("User purged: {uid}", user.UID);
dbContext.Auth.Remove(auth);