fix: 审批拒绝不发通知,仅保留创建/审批通过/执行结果三个通知点
This commit is contained in:
1 parent
880dbfefa4
commit
b92c3399e1
1 file changed
+9
-9
@@ -670,15 +670,15 @@ async def review_ticket(
|
||||
await db.commit()
|
||||
await db.refresh(ticket)
|
||||
|
||||
# 发送审批通知
|
||||
try:
|
||||
event_type = "ticket_approved" if data.action == "approve" else "ticket_rejected"
|
||||
await _send_ticket_notification(db, ticket, event_type, {
|
||||
"approver": current_user.display_name,
|
||||
"comment": data.comment or ("审批通过" if data.action == "approve" else "审批拒绝"),
|
||||
})
|
||||
except Exception as notify_err:
|
||||
logger.error("审批通知发送失败: %s", notify_err)
|
||||
# 发送审批通知(仅审批通过时通知,拒绝不通知)
|
||||
if data.action == "approve":
|
||||
try:
|
||||
await _send_ticket_notification(db, ticket, "ticket_approved", {
|
||||
"approver": current_user.display_name,
|
||||
"comment": data.comment or "审批通过",
|
||||
})
|
||||
except Exception as notify_err:
|
||||
logger.error("审批通知发送失败: %s", notify_err)
|
||||
|
||||
return await _enrich_ticket(ticket, db)
|
||||
|
||||
|
||||
Reference in new issue
Block a user