feat: task_ticket 默认发送通知
This commit is contained in:
parent
07822f093d
commit
7ab3535c83
|
@ -431,7 +431,7 @@ class WfService(object):
|
||||||
@classmethod
|
@classmethod
|
||||||
def task_ticket(cls, ticket: Ticket):
|
def task_ticket(cls, ticket: Ticket):
|
||||||
"""
|
"""
|
||||||
执行任务(自定义任务或通知)
|
执行任务(自定义任务和通知)
|
||||||
"""
|
"""
|
||||||
state = ticket.state
|
state = ticket.state
|
||||||
# 如果目标状态有func,由func执行额外操作(比如发送通知)
|
# 如果目标状态有func,由func执行额外操作(比如发送通知)
|
||||||
|
@ -440,7 +440,7 @@ class WfService(object):
|
||||||
m = importlib.import_module(module)
|
m = importlib.import_module(module)
|
||||||
f = getattr(m, func)
|
f = getattr(m, func)
|
||||||
f(ticket=ticket) # 同步执行
|
f(ticket=ticket) # 同步执行
|
||||||
else:
|
|
||||||
# wf默认只发送通知
|
# wf默认只发送通知
|
||||||
last_log = TicketFlow.objects.filter(ticket=ticket).order_by('-create_time').first()
|
last_log = TicketFlow.objects.filter(ticket=ticket).order_by('-create_time').first()
|
||||||
if (last_log.state != state or
|
if (last_log.state != state or
|
||||||
|
|
Loading…
Reference in New Issue