Skip to content

Commit

Permalink
Merge pull request #1208 from hanshuaikang/feature/develop_by_han
Browse files Browse the repository at this point in the history
快捷审批取消和通知渠道进行绑定
  • Loading branch information
hanshuaikang authored Oct 8, 2023
2 parents 302bfbb + fcae78d commit 0556133
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions itsm/component/bkchat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,34 +83,14 @@ def notify_fast_approval_message(ticket, state_id, receivers):
)
return

# 不通知
if ticket.flow.notify_rule == "NONE":
logger.info(
"[fast_approval({})]The notify_rule of the current flow: {}".format(
ticket.sn, ticket.flow.notify_rule
)
)
return

# 如果通知接收人为空则不通知
if not receivers:
logger.info("[fast_approval({})]There is no receivers".format(ticket.sn))
return

# 根据流程设定的通知方式通知
for _notify in ticket.flow.notify.all():
# 判断通知类型如果不是微信则返回
if _notify.type != "WEIXIN":
logger.info(
"[fast_approval({})]The current notify type: {}".format(
ticket.sn, _notify.type
)
)
return

content = build_bkchat_summary(ticket)
# 发送微信通知
send_fast_approval_message(ticket.title, content, receivers, ticket, state_id)
content = build_bkchat_summary(ticket)
# 发送微信通知
send_fast_approval_message(ticket.title, content, receivers, ticket, state_id)


def send_fast_approval_message(title, content, receivers, ticket, state_id):
Expand Down

0 comments on commit 0556133

Please sign in to comment.