Skip to content

Commit

Permalink
Merge pull request #381 from fanandli/v2.0.14
Browse files Browse the repository at this point in the history
对于"如果state已经删除,但是此时要查看此工作流的工单的列表详情就会报错"的处理
  • Loading branch information
blackholll committed Oct 17, 2022
2 parents 405f0f6 + 04b029b commit e40b64e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions service/ticket/ticket_base_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ def get_ticket_list(cls, sn: str='', title: str='', username: str='', create_sta
ticket_result_object_list = ticket_result_paginator.object_list
ticket_result_restful_list = []
for ticket_result_object in ticket_result_object_list:
flag, state_obj = workflow_state_service_ins.get_workflow_state_by_id(ticket_result_object.state_id)
state_name = state_obj.name if flag else '未知状态'
state_obj_flag, state_obj = workflow_state_service_ins.get_workflow_state_by_id(ticket_result_object.state_id)
state_name = state_obj.name if state_obj_flag else '未知状态'
flag, participant_info = cls.get_ticket_format_participant_info(ticket_result_object.id)

flag, workflow_obj = workflow_base_service_ins.get_by_id(ticket_result_object.workflow_id)
Expand All @@ -220,8 +220,12 @@ def get_ticket_list(cls, sn: str='', title: str='', username: str='', create_sta
creator_info = dict(username=ticket_result_object.creator, alias='', is_active=False, email='',
phone='', dept_info={})
ticket_format_obj = ticket_result_object.get_dict()

state_obj_label = '{}'
if state_obj_flag:
state_obj_label = json.loads(state_obj.label)
ticket_format_obj.update(dict(state=dict(state_id=ticket_result_object.state_id, state_name=state_name,
state_label=json.loads(state_obj.label)),
state_label=state_obj_label),
participant_info=participant_info, creator_info=creator_info,
workflow_info=workflow_info_dict))

Expand Down

0 comments on commit e40b64e

Please sign in to comment.