Skip to content

Commit 60d12ac

Browse files
committed
Serialize step tool_uuid as string, not UUID class instance
1 parent 8272fbf commit 60d12ac

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/galaxy/managers/workflows.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,7 @@ def _workflow_to_dict_editor(self, trans, stored, workflow, tooltip=True, is_sub
13081308
if isinstance(module, ToolModule) and module.tool:
13091309
# Serialize tool version
13101310
step_dict["tool_version"] = module.tool.version
1311+
step_dict["tool_uuid"] = str(step.tool_uuid) if step.tool_uuid else None
13111312
# Determine full (prefixed) names of valid input datasets
13121313
data_input_names = {}
13131314

@@ -1559,7 +1560,7 @@ def _workflow_to_dict_export(self, trans, stored=None, workflow=None, internal=F
15591560
}
15601561
if step.type == "tool":
15611562
step_dict["tool_id"] = content_id if allow_upgrade else step.tool_id
1562-
step_dict["tool_uuid"] = step.tool_uuid
1563+
step_dict["tool_uuid"] = str(step.tool_uuid) if step.tool_uuid else None
15631564
# Add tool shed repository information and post-job actions to step dict.
15641565
if isinstance(module, ToolModule):
15651566
if module.tool and module.tool.tool_shed:
@@ -1744,7 +1745,7 @@ def _workflow_to_dict_instance(self, trans, stored, workflow, legacy=True):
17441745
"id": step_id,
17451746
"type": step_type,
17461747
"tool_id": step.tool_id,
1747-
"tool_uuid": step.tool_uuid,
1748+
"tool_uuid": str(step.tool_uuid) if step.tool_uuid else None,
17481749
"tool_version": step.tool_version,
17491750
"annotation": self.get_item_annotation_str(sa_session, stored.user, step),
17501751
"tool_inputs": step.tool_inputs,
@@ -2064,10 +2065,14 @@ def get_all_tools(self, workflow):
20642065
if {
20652066
"tool_id": step.tool_id,
20662067
"tool_version": step.tool_version,
2067-
"tool_uuid": step.tool_uuid,
2068+
"tool_uuid": str(step.tool_uuid) if step.tool_uuid else None,
20682069
} not in tools:
20692070
tools.append(
2070-
{"tool_id": step.tool_id, "tool_version": step.tool_version, "tool_uuid": step.tool_uuid}
2071+
{
2072+
"tool_id": step.tool_id,
2073+
"tool_version": step.tool_version,
2074+
"tool_uuid": str(step.tool_uuid) if step.tool_uuid else None,
2075+
}
20712076
)
20722077
elif step.type == "subworkflow":
20732078
tools.extend(self.get_all_tools(step.subworkflow))

0 commit comments

Comments
 (0)