do not return human tasks from errored process instances w/ burnettk

This commit is contained in:
jasquat 2023-02-27 16:11:26 -05:00
parent 4d7b0038fc
commit aafeed409c
No known key found for this signature in database
1 changed files with 6 additions and 2 deletions

View File

@ -100,7 +100,8 @@ def task_list_my_tasks(
if process_instance_id is not None: if process_instance_id is not None:
human_task_query = human_task_query.filter( human_task_query = human_task_query.filter(
ProcessInstanceModel.id == process_instance_id ProcessInstanceModel.id == process_instance_id,
ProcessInstanceModel.status != ProcessInstanceStatus.error.value,
) )
potential_owner_usernames_from_group_concat_or_similar = ( potential_owner_usernames_from_group_concat_or_similar = (
@ -480,7 +481,10 @@ def _get_tasks(
.outerjoin(GroupModel, GroupModel.id == HumanTaskModel.lane_assignment_id) .outerjoin(GroupModel, GroupModel.id == HumanTaskModel.lane_assignment_id)
.join(ProcessInstanceModel) .join(ProcessInstanceModel)
.join(UserModel, UserModel.id == ProcessInstanceModel.process_initiator_id) .join(UserModel, UserModel.id == ProcessInstanceModel.process_initiator_id)
.filter(HumanTaskModel.completed == False) # noqa: E712 .filter(
HumanTaskModel.completed == False, # noqa: E712
ProcessInstanceModel.status != ProcessInstanceStatus.error.value,
)
) )
assigned_user = aliased(UserModel) assigned_user = aliased(UserModel)