Skip to content

Commit

Permalink
fix: 修改build_message多次传参task_id问题 TencentBlueKing#1464
Browse files Browse the repository at this point in the history
  • Loading branch information
huangpixu committed Jan 21, 2025
1 parent fa39a55 commit 4e697cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion itsm/ticket/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def retry_notify(ticket, state_id, receivers):
@shared_task
def notify_task(ticket, receivers, message, action, **kwargs):
"""发送通知"""
task_id = kwargs.get("task_id")
task_id = kwargs.pop("task_id", None)

# 关闭通知服务
if CLOSE_NOTIFY == "close":
Expand Down
3 changes: 3 additions & 0 deletions itsm/ticket/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ def build_message(_notify, task_id, ticket, message, action, **kwargs):
else:
custom_notify = get_custom_notify(ticket, action, _notify.type)

if task_id is not None:
kwargs["task_id"] = task_id

# 获取单据上下文
context = ticket.get_notify_context()
context.update(
Expand Down

0 comments on commit 4e697cd

Please sign in to comment.