feat(server): admin users list surfaces is_test_account
UserDetails carries the new column, search_users selects and optionally filters on it, and the /api/admin/users route accepts ?include_test=false to hide soak-harness accounts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,7 @@ async def list_users(
|
||||
offset: int = 0,
|
||||
include_banned: bool = True,
|
||||
include_deleted: bool = False,
|
||||
include_test: bool = True,
|
||||
admin: User = Depends(require_admin_v2),
|
||||
service: AdminService = Depends(get_admin_service_dep),
|
||||
):
|
||||
@@ -96,6 +97,10 @@ async def list_users(
|
||||
offset: Results to skip.
|
||||
include_banned: Include banned users.
|
||||
include_deleted: Include soft-deleted users.
|
||||
include_test: Include soak-harness test accounts (default true).
|
||||
Admins see all accounts by default; pass ?include_test=false
|
||||
to hide test accounts. Public stats endpoints default to
|
||||
hiding them.
|
||||
"""
|
||||
users = await service.search_users(
|
||||
query=query,
|
||||
@@ -103,6 +108,7 @@ async def list_users(
|
||||
offset=offset,
|
||||
include_banned=include_banned,
|
||||
include_deleted=include_deleted,
|
||||
include_test=include_test,
|
||||
)
|
||||
return {"users": [u.to_dict() for u in users]}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user