mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-04-30 04:14:13 +00:00
* perf: 重构 ticket * perf: 优化 tickets * perf: 暂存 * perf: 建立 ticket model * perf: 暂存一下 * perf: 修改 tickets * perf: 修改 import * perf: 修改model * perf: 暂存一波 * perf: 修改... * del process_map field * 工单重构 * 资产 应用对接前端 * perf: 修改 ticket * fix: bug * 修改迁移文件 * 添加其他api * 去掉process_map * perf: 优化去掉 signal * perf: 修改这里 * 修改一点 * perf: 修改工单 * perf: 修改状态 * perf: 修改工单流转 * step 状态切换 * perf: 修改 ticket open * perf: 修改流程 * perf: stash it * 改又改 * stash it * perf: stash * stash * migrate * perf migrate * 调整一下 * 修复bug * 修改一点 * 修改一点 * 优化一波 * perf: ticket migrations Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: feng626 <1304903146@qq.com>
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
#
|
|
from django.conf import settings
|
|
|
|
from common.utils import get_logger
|
|
from .notifications import TicketAppliedToAssigneeMessage, TicketProcessedToApplicantMessage
|
|
|
|
logger = get_logger(__file__)
|
|
|
|
|
|
def send_ticket_applied_mail_to_assignees(ticket, assignees):
|
|
if not assignees:
|
|
logger.debug(
|
|
"Not found assignees, ticket: {}({}), assignees: {}".format(
|
|
ticket, str(ticket.id), assignees
|
|
)
|
|
)
|
|
return
|
|
|
|
for user in assignees:
|
|
instance = TicketAppliedToAssigneeMessage(user, ticket)
|
|
if settings.DEBUG:
|
|
logger.debug(instance)
|
|
instance.publish_async()
|
|
|
|
|
|
def send_ticket_processed_mail_to_applicant(ticket, processor):
|
|
if not ticket.applicant:
|
|
logger.error("Not found applicant: {}({})".format(ticket.title, ticket.id))
|
|
return
|
|
|
|
instance = TicketProcessedToApplicantMessage(ticket.applicant, ticket, processor)
|
|
if settings.DEBUG:
|
|
logger.debug(instance)
|
|
instance.publish_async()
|