diff --git a/ProjectLighthouse/Helpers/StatisticsHelper.cs b/ProjectLighthouse/Helpers/StatisticsHelper.cs index a4c6b001..a2a27d6a 100644 --- a/ProjectLighthouse/Helpers/StatisticsHelper.cs +++ b/ProjectLighthouse/Helpers/StatisticsHelper.cs @@ -12,7 +12,7 @@ public static class StatisticsHelper public static async Task SlotCount() => await database.Slots.CountAsync(); - public static async Task UserCount() => await database.Users.CountAsync(); + public static async Task UserCount() => await database.Users.CountAsync(u => !u.Banned); public static async Task MMPicksCount() => await database.Slots.CountAsync(s => s.TeamPick); diff --git a/ProjectLighthouse/Pages/UsersPage.cshtml.cs b/ProjectLighthouse/Pages/UsersPage.cshtml.cs index d5535648..d5125384 100644 --- a/ProjectLighthouse/Pages/UsersPage.cshtml.cs +++ b/ProjectLighthouse/Pages/UsersPage.cshtml.cs @@ -34,8 +34,9 @@ public class UsersPage : BaseLayout if (this.PageNumber < 0 || this.PageNumber >= this.PageAmount) return this.Redirect($"/users/{Math.Clamp(this.PageNumber, 0, this.PageAmount - 1)}"); - this.Users = await this.Database.Users.OrderByDescending - (p => p.UserId) + this.Users = await this.Database.Users.Where + (u => !u.Banned) + .OrderByDescending(b => b.UserId) .Skip(pageNumber * ServerStatics.PageSize) .Take(ServerStatics.PageSize) .ToListAsync();