瀏覽代碼

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

tags/0.14.2
Kalo Chin 10 月之前
父節點
當前提交
786cb6859b
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. 6
    0
      api/core/app/task_pipeline/workflow_cycle_manage.py

+ 6
- 0
api/core/app/task_pipeline/workflow_cycle_manage.py 查看文件

@@ -505,6 +505,12 @@ class WorkflowCycleManage:
:param workflow_run: workflow run
: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
if workflow_run.created_by_role == CreatedByRole.ACCOUNT.value:
created_by_account = workflow_run.created_by_account

Loading…
取消
儲存