Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions reana_workflow_controller/rest/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ def get_workflows(args, paginate=None): # noqa
column_sorted = nullslast(WorkflowResource.quota_used.desc())
elif sort in ["asc", "desc"]:
column_sorted = getattr(Workflow.created, sort)()

if type_ == "interactive":
# Keep only workflows that have at least one interactive session.
query = query.filter(Workflow.sessions.any())
pagination_dict = paginate(query.order_by(column_sorted))

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