Skip to content

Commit 2fcefaa

Browse files
committed
fix: ws and wf endpoints
1 parent 3808612 commit 2fcefaa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/server/operandi_server/routers/workflow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from fastapi.responses import FileResponse
1313
from fastapi.security import HTTPBasic, HTTPBasicCredentials
1414

15+
from operandi_utils import create_db_query
1516
from operandi_utils.constants import AccountType, ServerApiTag, StateJob, StateWorkspace
1617
from operandi_utils.database import (
1718
db_create_page_stat_with_handling, db_create_workflow, db_create_workflow_job, db_get_hpc_slurm_job,
@@ -128,7 +129,8 @@ async def list_workflows(
128129
The expected datetime format: YYYY-MM-DDTHH:MM:SS, for example, 2024-12-01T18:17:15
129130
"""
130131
current_user = await user_auth_with_handling(self.logger, auth)
131-
return await get_user_workflows(current_user.user_id, start_date, end_date, True)
132+
query = create_db_query(current_user.user_id, start_date, end_date, hide_deleted=True)
133+
return await get_user_workflows(logger=self.logger, query=query)
132134

133135
async def download_workflow_script(
134136
self, workflow_id: str, auth: HTTPBasicCredentials = Depends(HTTPBasic())

src/server/operandi_server/routers/workspace.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from fastapi.responses import FileResponse
1010
from fastapi.security import HTTPBasic, HTTPBasicCredentials
1111

12+
from operandi_utils import create_db_query
1213
from operandi_utils.constants import ServerApiTag, StateWorkspace
1314
from operandi_utils.database import (
1415
db_create_page_stat_with_handling, db_create_workspace, db_get_workspace, db_update_workspace)
@@ -102,7 +103,8 @@ async def list_workspaces(
102103
The expected datetime format: YYYY-MM-DDTHH:MM:SS, for example, 2024-12-01T18:17:15
103104
"""
104105
current_user = await user_auth_with_handling(self.logger, auth)
105-
return await get_user_workspaces(current_user.user_id, start_date, end_date, True)
106+
query = create_db_query(current_user.user_id, start_date, end_date, hide_deleted=True)
107+
return await get_user_workspaces(logger=self.logger, query=query)
106108

107109
async def download_workspace(
108110
self, background_tasks: BackgroundTasks, workspace_id: str, auth: HTTPBasicCredentials = Depends(HTTPBasic())

0 commit comments

Comments
 (0)