Skip to content

Commit

Permalink
Fix up action_arguments for workflows converted by gxformat2 < 0.20.0
Browse files Browse the repository at this point in the history
Fixes #18995
  • Loading branch information
mvdbeek committed Nov 28, 2024
1 parent 91fc1d8 commit 1503622
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,7 @@ class PostJobAction(Base, RepresentById):
workflow_step_id = Column(Integer, ForeignKey("workflow_step.id"), index=True, nullable=True)
action_type = Column(String(255), nullable=False)
output_name = Column(String(255), nullable=True)
action_arguments = Column(MutableJSONType, nullable=True)
_action_arguments = Column("action_arguments", MutableJSONType, nullable=True)
workflow_step = relationship(
"WorkflowStep",
back_populates="post_job_actions",
Expand All @@ -2500,6 +2500,18 @@ def __init__(self, action_type, workflow_step=None, output_name=None, action_arg
self.workflow_step = workflow_step
ensure_object_added_to_session(self, object_in_session=workflow_step)

@property
def action_arguments(self):
if self.action_type == "HideDatasetAction" and self._action_arguments is True:
# Fix up broken workflows resulting from imports with gxformat2 <= 0.20.0
return {}
else:
return self._action_arguments

@action_arguments.setter
def action_arguments(self, value: Dict[str, Any]):
self._action_arguments = value


class PostJobActionAssociation(Base, RepresentById):
__tablename__ = "post_job_action_association"
Expand Down

0 comments on commit 1503622

Please sign in to comment.