|
|
|
@ -257,16 +257,6 @@ namespace Jellyfin.Server.Implementations.Users
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await using var dbContext = _dbProvider.CreateContext();
|
|
|
|
|
|
|
|
|
|
// Clear all entities related to the user from the database.
|
|
|
|
|
if (user.ProfileImage != null)
|
|
|
|
|
{
|
|
|
|
|
dbContext.Remove(user.ProfileImage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dbContext.RemoveRange(user.Permissions);
|
|
|
|
|
dbContext.RemoveRange(user.Preferences);
|
|
|
|
|
dbContext.RemoveRange(user.AccessSchedules);
|
|
|
|
|
dbContext.Users.Remove(user);
|
|
|
|
|
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
|
|
|
|
_users.Remove(userId);
|
|
|
|
|