refac: has_users

Co-Authored-By: pickle-dice <159401444+hassan-ajek@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2025-08-05 22:15:22 +04:00
co-authored by pickle-dice
parent 53a328d00b
commit f24b76d9a3
3 changed files with 13 additions and 14 deletions
+4
View File
@@ -258,6 +258,10 @@ class UsersTable:
with get_db() as db:
return db.query(User).count()
def has_users(self) -> bool:
with get_db() as db:
return db.query(db.query(User).exists()).scalar()
def get_first_user(self) -> UserModel:
try:
with get_db() as db: