fix: rewrite condition for admin counting
All checks were successful
Update changelog / changelog (push) Successful in 25s
All checks were successful
Update changelog / changelog (push) Successful in 25s
This commit is contained in:
@@ -66,7 +66,7 @@ public class Seeder
|
|||||||
if (userCount == 0)
|
if (userCount == 0)
|
||||||
Console.WriteLine("[Warn]: No user accounts found. Running a server no one can access! Consider creating an account with `Shadow addUser`.");
|
Console.WriteLine("[Warn]: No user accounts found. Running a server no one can access! Consider creating an account with `Shadow addUser`.");
|
||||||
|
|
||||||
int adminCount = db.Users.Count(u => u.IsAdmin());
|
int adminCount = db.Users.Count(u => u.Role == 0); // equivalent to u.IsAdmin()
|
||||||
if (adminCount == 0 && userCount > 0)
|
if (adminCount == 0 && userCount > 0)
|
||||||
Console.WriteLine("[Warn]: No admin accounts exist. Consider creating one with `Shadow addUser`.");
|
Console.WriteLine("[Warn]: No admin accounts exist. Consider creating one with `Shadow addUser`.");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user