Skip to content

Commit

Permalink
Set cascade_backrefs=False on WorkflowStep.workflow_outputs, add safe…
Browse files Browse the repository at this point in the history
…guard
  • Loading branch information
jdavcs committed Dec 4, 2023
1 parent 855a0c1 commit 5abd3e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7688,7 +7688,7 @@ class WorkflowStep(Base, RepresentById):
)
post_job_actions = relationship("PostJobAction", back_populates="workflow_step", cascade_backrefs=False)
inputs = relationship("WorkflowStepInput", back_populates="workflow_step")
workflow_outputs = relationship("WorkflowOutput", back_populates="workflow_step")
workflow_outputs = relationship("WorkflowOutput", back_populates="workflow_step", cascade_backrefs=False)
output_connections = relationship(
"WorkflowStepConnection", primaryjoin=(lambda: WorkflowStepConnection.output_step_id == WorkflowStep.id)
)
Expand Down Expand Up @@ -8074,6 +8074,9 @@ class WorkflowOutput(Base, Serializable):

def __init__(self, workflow_step, output_name=None, label=None, uuid=None):
self.workflow_step = workflow_step
# Safeguard: self was implicitly merged into this Session prior to SQLAlchemy 2.0.
if object_session(workflow_step):
object_session(workflow_step).add(self)
self.output_name = output_name
self.label = label
self.uuid = get_uuid(uuid)
Expand Down

0 comments on commit 5abd3e2

Please sign in to comment.