fix: update UserRole references to lowercase in admin.py

This commit is contained in:
2026-06-22 21:32:05 -06:00
parent 3c528ec9f1
commit 50316f82fd
+2 -2
View File
@@ -15,7 +15,7 @@ async def get_queue(
db: AsyncSession = Depends(get_db), db: AsyncSession = Depends(get_db),
_: User = Depends(get_admin_user), _: User = Depends(get_admin_user),
): ):
result = await db.execute(select(User).where(User.role == UserRole.PENDING)) result = await db.execute(select(User).where(User.role == UserRole.pending))
return result.scalars().all() return result.scalars().all()
@@ -42,7 +42,7 @@ async def approve_user(
user = result.scalar_one_or_none() user = result.scalar_one_or_none()
if not user: if not user:
raise HTTPException(status_code=404, detail="User not found") raise HTTPException(status_code=404, detail="User not found")
user.role = UserRole.APPROVED user.role = UserRole.approved
await db.commit() await db.commit()
await db.refresh(user) await db.refresh(user)
return user return user