Browse Source

fix: ensure WorkflowRun attributes are refreshed in WorkflowCycleMana… (#11913)

tags/0.14.2
Kalo Chin 10 months ago
parent
commit
786cb6859b
No account linked to committer's email address
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      api/core/app/task_pipeline/workflow_cycle_manage.py

+ 6
- 0
api/core/app/task_pipeline/workflow_cycle_manage.py View File

:param workflow_run: workflow run :param workflow_run: workflow run
:return: :return:
""" """
# Attach WorkflowRun to an active session so "created_by_role" can be accessed.
workflow_run = db.session.merge(workflow_run)

# Refresh to ensure any expired attributes are fully loaded
db.session.refresh(workflow_run)

created_by = None created_by = None
if workflow_run.created_by_role == CreatedByRole.ACCOUNT.value: if workflow_run.created_by_role == CreatedByRole.ACCOUNT.value:
created_by_account = workflow_run.created_by_account created_by_account = workflow_run.created_by_account

Loading…
Cancel
Save