From 9afba07d74efea8ca48caaba6fa3740ee7ef97c5 Mon Sep 17 00:00:00 2001 From: Stuart Campbell Date: Thu, 1 Feb 2024 15:09:24 -0500 Subject: [PATCH 1/2] Update ProposalDirectories model in proposal_model.py --- src/nsls2api/api/models/proposal_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nsls2api/api/models/proposal_model.py b/src/nsls2api/api/models/proposal_model.py index 0bbae708..ce477c7d 100644 --- a/src/nsls2api/api/models/proposal_model.py +++ b/src/nsls2api/api/models/proposal_model.py @@ -56,8 +56,10 @@ class ProposalUser(pydantic.BaseModel): class ProposalDirectories(pydantic.BaseModel): path: str owner: str - group: str | None = "" + group: str | None = None group_writable: bool | None = False + beamline: str | None = None + cycle: str | None = None users: list[dict[str, str]] groups: list[dict[str, str]] From 428f35adb221035ac5b72caa80276a9948d22a95 Mon Sep 17 00:00:00 2001 From: Stuart Campbell Date: Thu, 1 Feb 2024 15:09:43 -0500 Subject: [PATCH 2/2] Add beamline and cycle information to directories response --- src/nsls2api/services/proposal_service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nsls2api/services/proposal_service.py b/src/nsls2api/services/proposal_service.py index 41f43802..40e00cbf 100644 --- a/src/nsls2api/services/proposal_service.py +++ b/src/nsls2api/services/proposal_service.py @@ -310,6 +310,8 @@ async def directories(proposal_id: int): "path": str( data_root / "proposals" / str(cycle) / proposal.data_session ), + "beamline": beamline.upper(), + "cycle": str(cycle), "owner": "nsls2data", "group": proposal.data_session, "group_writable": True,