Skip to content

Commit 206f653

Browse files
committed
fix(admins): update query conditions for admin status checks
1 parent f23b267 commit 206f653

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/db/crud/admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,15 @@ async def get_admins(
211211
active_stmt = select(func.count(Admin.id))
212212
if username:
213213
active_stmt = active_stmt.where(Admin.username.ilike(f"%{username}%"))
214-
active_stmt = active_stmt.where(Admin.is_disabled == False)
214+
active_stmt = active_stmt.where(Admin.is_disabled.is_(False))
215215
result = await db.execute(active_stmt)
216216
active = result.scalar()
217217

218218
# Get disabled count
219219
disabled_stmt = select(func.count(Admin.id))
220220
if username:
221221
disabled_stmt = disabled_stmt.where(Admin.username.ilike(f"%{username}%"))
222-
disabled_stmt = disabled_stmt.where(Admin.is_disabled == True)
222+
disabled_stmt = disabled_stmt.where(Admin.is_disabled.is_(True))
223223
result = await db.execute(disabled_stmt)
224224
disabled = result.scalar()
225225

0 commit comments

Comments
 (0)