Skip to content

Commit 52786cd

Browse files
author
Michael Buchar
committed
feat(list): display interactive sessions (#436)
Correct pagination for API requests using the interactive type query parameter. Relates to #435
1 parent 9880f76 commit 52786cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

reana_workflow_controller/rest/workflows.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ def get_workflows(args, paginate=None): # noqa
377377
column_sorted = nullslast(WorkflowResource.quota_used.desc())
378378
elif sort in ["asc", "desc"]:
379379
column_sorted = getattr(Workflow.created, sort)()
380+
381+
if type_ == "interactive":
382+
# Keep only workflows that have at least one interactive session.
383+
query = query.filter(Workflow.sessions.any())
380384
pagination_dict = paginate(query.order_by(column_sorted))
381385

382386
owner_ids = {workflow.owner_id for workflow in pagination_dict["items"]}

0 commit comments

Comments
 (0)