Skip to content

Commit 1513621

Browse files
committed
fix: remove preferred username from the search body of the summary if admin
1 parent 02dadfa commit 1513621

File tree

2 files changed

+6
-2
lines changed
  • diracx-logic/src/diracx/logic/jobs
  • diracx-routers/src/diracx/routers/jobs

2 files changed

+6
-2
lines changed

diracx-logic/src/diracx/logic/jobs/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def search(
8484
async def summary(
8585
config: Config,
8686
job_db: JobDB,
87-
preferred_username: str,
87+
preferred_username: str | None,
8888
body: SummaryParams,
8989
):
9090
"""Show information suitable for plotting."""

diracx-routers/src/diracx/routers/jobs/query.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,13 @@ async def summary(
304304
"""
305305
await check_permissions(action=ActionType.QUERY, job_db=job_db)
306306

307+
preferred_username: str | None = user_info.preferred_username
308+
if JOB_ADMINISTRATOR in user_info.properties:
309+
preferred_username = None
310+
307311
return await summary_bl(
308312
config=config,
309313
job_db=job_db,
310-
preferred_username=user_info.preferred_username,
314+
preferred_username=preferred_username,
311315
body=body,
312316
)

0 commit comments

Comments
 (0)