From 9b8eb911c3bf2b0be84a73030e82cff12151d4ba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Mar 2026 11:07:37 +0000 Subject: [PATCH] fix(admin-users): restore missing @router.get decorator on get_user endpoint The @router.get("/{user_id:path}") decorator was accidentally dropped from the get_user function when the /local/... routes were inserted above it in the previous PR. Without the decorator the function was never registered as a GET handler, so GET /api/admin/users/ matched the PUT/DELETE catch-all routes and Starlette correctly returned 405 Method Not Allowed instead of 200/403. Adding the decorator back restores the GET endpoint and fixes the 5 tests that were failing with 405. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- app/api/admin_users.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/api/admin_users.py b/app/api/admin_users.py index d73a1467..67d453ef 100644 --- a/app/api/admin_users.py +++ b/app/api/admin_users.py @@ -502,6 +502,7 @@ def admin_set_password( return {"updated": True, "email": user.email} +@router.get("/{user_id:path}", summary="Get details for a single user") def get_user(user_id: str, db: DbSession, _admin: AdminUser) -> dict[str, Any]: """Return profile and document statistics for a specific user.""" doc_count = db.query(func.count(FileRecord.id)).filter(FileRecord.owner_id == user_id).scalar() or 0