diff --git a/sda_orchestrator/utils/id_ops.py b/sda_orchestrator/utils/id_ops.py index ca44cb6..41861cf 100644 --- a/sda_orchestrator/utils/id_ops.py +++ b/sda_orchestrator/utils/id_ops.py @@ -106,6 +106,7 @@ async def create_draft_doi(self, user: str, inbox_path: str) -> Union[Dict, None "dataset": f"{self.ns_url}/{_suffix.lower()}", } else: + LOG.debug(f"DOI draft created and response was: {response}") LOG.error(f"DOI API create draft request failed with code: {response.status_code}") doi_data = self._check_errors(response, doi_suffix) @@ -182,7 +183,7 @@ def _check_errors(self, response: Response, doi_suffix: str) -> Union[Dict, None doi_data = None if len(errors_resp) == 1: error_msg = errors_resp[0]["title"] if "title" in errors_resp[0] else errors_resp[0]["detail"] - if errors_resp[0]["source"] == "doi" and error_msg == "This DOI has already been taken": + if "source" in errors_resp[0] and error_msg == "This DOI has already been taken": LOG.info("DOI already taken, we will associate the submission to this doi dataset.") doi_data = { "suffix": doi_suffix,