From fa7608053a2df2716bb4dd3d956b7d1fbd6cbe55 Mon Sep 17 00:00:00 2001 From: Dan Funk Date: Tue, 14 Jul 2020 22:23:54 -0400 Subject: [PATCH] fixing a failed test. --- crc/services/workflow_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crc/services/workflow_service.py b/crc/services/workflow_service.py index 9affb720..09ea68c1 100644 --- a/crc/services/workflow_service.py +++ b/crc/services/workflow_service.py @@ -222,7 +222,7 @@ class WorkflowService(object): nav_item['title'] = nav_item['task'].title # Prefer the task title. user_uids = WorkflowService.get_users_assigned_to_task(processor, spiff_task) - if g.user.uid not in user_uids: + if 'user' not in g or not g.user or g.user.uid not in user_uids: nav_item['state'] = WorkflowService.TASK_STATE_LOCKED else: @@ -255,7 +255,7 @@ class WorkflowService(object): workflow_api.next_task = WorkflowService.spiff_task_to_api_task(next_task, add_docs_and_forms=True) # Update the state of the task to locked if the current user does not own the task. user_uids = WorkflowService.get_users_assigned_to_task(processor, next_task) - if g.user.uid not in user_uids: + if 'user' not in g or not g.user or g.user.uid not in user_uids: workflow_api.next_task.state = WorkflowService.TASK_STATE_LOCKED return workflow_api