fix: update UserRole references to lowercase in admin.py
This commit is contained in:
@@ -15,7 +15,7 @@ async def get_queue(
|
||||
db: AsyncSession = Depends(get_db),
|
||||
_: 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()
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ async def approve_user(
|
||||
user = result.scalar_one_or_none()
|
||||
if not user:
|
||||
raise HTTPException(status_code=404, detail="User not found")
|
||||
user.role = UserRole.APPROVED
|
||||
user.role = UserRole.approved
|
||||
await db.commit()
|
||||
await db.refresh(user)
|
||||
return user
|
||||
|
||||
Reference in New Issue
Block a user