Fix incorrect exception handling in db query (#23582)

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
This commit is contained in:
Yongtao Huang
2025-08-08 10:07:59 +09:00
committed by GitHub
parent 2edd32fdea
commit c8c591d73c
5 changed files with 20 additions and 20 deletions

View File

@@ -256,7 +256,7 @@ class WorkflowDraftVariableService:
def _reset_node_var_or_sys_var(
self, workflow: Workflow, variable: WorkflowDraftVariable
) -> WorkflowDraftVariable | None:
# If a variable does not allow updating, it makes no sence to resetting it.
# If a variable does not allow updating, it makes no sense to reset it.
if not variable.editable:
return variable
# No execution record for this variable, delete the variable instead.
@@ -478,7 +478,7 @@ def _batch_upsert_draft_variable(
"node_execution_id": stmt.excluded.node_execution_id,
},
)
elif _UpsertPolicy.IGNORE:
elif policy == _UpsertPolicy.IGNORE:
stmt = stmt.on_conflict_do_nothing(index_elements=WorkflowDraftVariable.unique_app_id_node_id_name())
else:
raise Exception("Invalid value for update policy.")