Skip to content

Commit

Permalink
Fix registration request query
Browse files Browse the repository at this point in the history
  • Loading branch information
Serious-senpai committed Sep 21, 2024
1 parent df6fb66 commit c606572
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion server/models/reg_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ async def query(cls, *, offset: int) -> List[RegisterRequest]:
"""
SELECT * FROM register_queue
ORDER BY request_id DESC
OFFSET ? FETCH ? ROWS ONLY
OFFSET ? ROWS
FETCH NEXT ? ROWS ONLY
""",
offset,
DB_PAGINATION_QUERY,
Expand Down
4 changes: 2 additions & 2 deletions server/routes/api/admin/reg_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

@api_router.get(
"/admin/reg_request",
name=f"Query a maximum of {DB_PAGINATION_QUERY} registration requests from the specified offset",
name="Query registration requests",
tags=["admin", "query"],
responses={status.HTTP_401_UNAUTHORIZED: {}},
status_code=status.HTTP_200_OK,
)
async def admin_login(offset: int, headers: Annotated[Authorization, Header()]) -> List[RegisterRequest]:
"""Verify administrator authorization data, return 204 on success, 403 on failure"""
f"""Query a maximum of {DB_PAGINATION_QUERY} registration requests from the specified offset"""
if not await Database.instance.verify_admin(headers.username, headers.password):
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED)

Expand Down

0 comments on commit c606572

Please sign in to comment.