From 6195c139761cc51955adde704a39c7034f399a90 Mon Sep 17 00:00:00 2001 From: blackholll Date: Tue, 7 May 2019 23:12:24 +0800 Subject: [PATCH] do not add flow_log when hand_ticket is call from task --- service/ticket/ticket_base_service.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service/ticket/ticket_base_service.py b/service/ticket/ticket_base_service.py index b010a119..391e5bae 100644 --- a/service/ticket/ticket_base_service.py +++ b/service/ticket/ticket_base_service.py @@ -1067,8 +1067,9 @@ def handle_ticket(cls, ticket_id, request_data_dict, by_timer=False, by_task=Fal for key, value in ticket_all_data.items(): if type(value) not in [int, str, bool, float]: ticket_all_data[key] = str(ticket_all_data[key]) - - cls.add_ticket_flow_log(dict(ticket_id=ticket_id, transition_id=transition_id, suggestion=suggestion, + if not by_task: + # 脚本执行完自动触发的流转,因为在run_flow_task已经有记录操作日志,所以此次不再记录 + cls.add_ticket_flow_log(dict(ticket_id=ticket_id, transition_id=transition_id, suggestion=suggestion, participant_type_id=CONSTANT_SERVICE.PARTICIPANT_TYPE_PERSONAL, participant=username, state_id=source_ticket_state_id, creator=username, ticket_data=json.dumps(ticket_all_data)))