Skip to content

Commit

Permalink
fix: 修复create_task api execute_task_nodes_id 传参时有两次replace_id操作导致报错问题 T…
Browse files Browse the repository at this point in the history
  • Loading branch information
lTimej committed May 7, 2024
1 parent 0c997b0 commit 9589c55
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions gcloud/template_base/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,15 @@ def replace_template_id(template_model, pipeline_data, reverse=False):
apps.get_model("template", "CommonTemplate") if act.get("template_source") == COMMON else template_model
)
if not reverse:
act["template_id"] = subprocess_template_model.objects.get(
pk=act["template_id"]
).pipeline_template.template_id
template = subprocess_template_model.objects.filter(pk=act["template_id"]).first()
if template:
act["template_id"] = template.pipeline_template.template_id
else:
template = subprocess_template_model.objects.get(pipeline_template__template_id=act["template_id"])
act["template_id"] = str(template.pk)
template = subprocess_template_model.objects.filter(
pipeline_template__template_id=act["template_id"]
).first()
if template:
act["template_id"] = str(template.pk)


def inject_template_node_id(pipeline_tree: dict):
Expand Down

0 comments on commit 9589c55

Please sign in to comment.