Skip to content
Snippets Groups Projects
Commit d8211797 authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

make sure user_email field doesn't override contacts_wrest when it's an analyst list only

parent 5dc50ff1
No related branches found
No related tags found
2 merge requests!1571catch 2.8.2.3 up with main,!1527make sure user_email field doesn't override contacts_wrest when it's an analyst list only
Pipeline #12855 passed
......@@ -25,7 +25,6 @@ import json
import logging
import subprocess
import requests
from pycapo import CapoConfig
from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound, HTTPPreconditionFailed
from pyramid.request import Request
......@@ -394,9 +393,12 @@ def get_user_email(request: Request) -> Response:
if not version.parameters:
not_found_msg = f"No parameters found for version {version_id} of request with ID {capability_request_id}. Couldn't find user_email information."
return HTTPNotFound(detail=not_found_msg)
elif "user_email" in version.parameters and version.parameters["user_email"]:
elif ("user_email" in version.parameters and version.parameters["user_email"]
and "workspaces-analysts" not in version.parameters["user_email"]):
# exclude the case of follow-on requests when the default user_email is the analyst list,
# otherwise send to specified address
return Response(status_int=http.HTTPStatus.OK, json_body={"resp": f"{version.parameters['user_email']}"})
# If user_email not populated, search for the PI/CoI emails with the contacts_wrester
# If user_email not populated (or is an analyst list), search for the PI/CoI emails with the contacts_wrester
elif "product_locator" in version.parameters and version.parameters["product_locator"]:
process_call = ["aat_wrest", "-sc", version.parameters["product_locator"]]
elif "sdmId" in version.parameters and version.parameters["sdmId"]:
......
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