Skip to content

Commit

Permalink
Fix import of previously-deleted TRS workflow
Browse files Browse the repository at this point in the history
By returning latest, non-deleted workflow in
`get_workflow_by_trs_id_and_version`.

Fixes #19263
  • Loading branch information
mvdbeek committed Dec 11, 2024
1 parent f5f2efe commit 69f2c18
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/galaxy/managers/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -2083,6 +2083,7 @@ def to_json(column, keys: List[str]):
.join(model.Workflow, model.Workflow.id == model.StoredWorkflow.latest_workflow_id)
.filter(
and_(
model.StoredWorkflow.deleted == false(),
to_json(model.Workflow.source_metadata, ["trs_tool_id"]) == trs_id,
to_json(model.Workflow.source_metadata, ["trs_version_id"]) == trs_version,
)
Expand All @@ -2094,7 +2095,7 @@ def to_json(column, keys: List[str]):
)
else:
stmnt = stmnt.filter(model.StoredWorkflow.importable == true())
return sa_session.execute(stmnt).scalar()
return sa_session.execute(stmnt.order_by(model.StoredWorkflow.id.desc()).limit(1)).scalar()


class RefactorRequest(RefactorActions):
Expand Down

0 comments on commit 69f2c18

Please sign in to comment.