Skip to content
Snippets Groups Projects
Commit 1765d35f authored by Nathan Bockisch's avatar Nathan Bockisch
Browse files

Deal with case where no WorkflowRequest was retrieved

parent 86be9583
No related branches found
No related tags found
1 merge request!1458WS-1977: Make sure workflow requests QA announced from the UI have user_email field populated
......@@ -520,7 +520,10 @@ class WorkflowRequestRestService:
:return: A formatted string with the emails or an empty string if the contact info couldn't be retrieved
"""
if requested_workflow.argument is not None:
if requested_workflow is None:
logger.debug("get_contacts: Provided an invalid WorkflowRequest")
return ""
elif requested_workflow.argument is not None:
if "user_email" in requested_workflow.argument:
return requested_workflow.argument["user_email"]
elif "product_locator" in requested_workflow.argument:
......@@ -552,7 +555,7 @@ class WorkflowRequestRestService:
) as wrested_contacts:
contacts = wrested_contacts.communicate()[0]
if "ERROR" in contacts.decode():
logger.info(f"Contact wrester failed for project {project_code}")
logger.debug(f"Contact wrester failed for project {project_code}")
return ""
email_list = json.loads(contacts.decode())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment