Skip to content

Commit

Permalink
fix: 处理 fast_create_task 通知人覆盖问题 TencentBlueKing#39
Browse files Browse the repository at this point in the history
  • Loading branch information
normal-wls committed Oct 21, 2024
1 parent e8698a7 commit 62db74b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions bkflow/apigw/serializers/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class CreateTaskWithoutTemplateSerializer(serializers.Serializer):
description = serializers.CharField(help_text=_("任务描述"), required=False)
constants = serializers.JSONField(help_text=_("任务启动参数"), required=False, default={})
pipeline_tree = serializers.JSONField(help_text=_("任务树"), required=True)
notify_config = serializers.JSONField(help_text=_("通知配置"), required=False, default={})


class PipelineTreeSerializer(serializers.Serializer):
Expand Down
3 changes: 2 additions & 1 deletion bkflow/apigw/views/create_task_without_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def create_task_without_template(request, space_id):
"notify_type": {"fail": [], "success": []},
"notify_receivers": {"more_receiver": "", "receiver_group": []},
}
create_task_data.setdefault("extra_info", {}).update({"notify_config": DEFAULT_NOTIFY_CONFIG})
notify_config = create_task_data.pop("notify_config", {}) or DEFAULT_NOTIFY_CONFIG
create_task_data.setdefault("extra_info", {}).update({"notify_config": notify_config})

client = TaskComponentClient(space_id=space_id)
result = client.create_task(create_task_data)
Expand Down

0 comments on commit 62db74b

Please sign in to comment.