diff --git a/metadata_backend/api/handlers/publish.py b/metadata_backend/api/handlers/publish.py index a75da396..5a1683f7 100644 --- a/metadata_backend/api/handlers/publish.py +++ b/metadata_backend/api/handlers/publish.py @@ -443,11 +443,13 @@ async def _publish_rems(self, submission: dict[str, Any], obj_op: ObjectOperator if "metaxIdentifier" in ds: new_description = ds["description"] + f"\n\nSD Apply's Application link: {rems_url}" await self.metax_handler.update_draft_dataset_description(ds["metaxIdentifier"], new_description) + + # Update metadata object with preserved rems info that might need later await obj_op.update_metadata_object( ds["schema"], ds["accession_id"], { - "rems": { + "internal_rems": { "url": rems_url, "resourceId": resource_id, "catalogueId": catalogue_id, diff --git a/metadata_backend/helpers/schemas/submission.json b/metadata_backend/helpers/schemas/submission.json index 815adf5e..ecf7f677 100644 --- a/metadata_backend/helpers/schemas/submission.json +++ b/metadata_backend/helpers/schemas/submission.json @@ -1141,7 +1141,7 @@ } } }, - "rems": { + "internal_rems": { "url": { "type": "string", "title": "URL for application to apply access for dataset in REMS" diff --git a/tests/integration/test_publications.py b/tests/integration/test_publications.py index 7e362ac9..eed25b91 100644 --- a/tests/integration/test_publications.py +++ b/tests/integration/test_publications.py @@ -72,7 +72,7 @@ async def test_minimal_fega_json_publication_rems(self, client_logged_in, submis LOG.debug(f"Checking that dataset {ds_id} in submission {submission_fega} has rems data") res = await resp.json() assert res["accessionId"] == ds_id, "expected dataset id does not match" - assert "rems" in res, "expected rems field not found in dataset" - assert "url" in res["rems"], "expected url not found in rems field" - assert "resourceId" in res["rems"], "expected resourceId not found in rems field" - assert "catalogueId" in res["rems"], "expected catalogueId not found in rems field" + assert "internal_rems" in res, "expected internal_rems field not found in dataset" + assert "url" in res["internal_rems"], "expected url not found in internal_rems field" + assert "resourceId" in res["internal_rems"], "expected resourceId not found in internal_rems field" + assert "catalogueId" in res["internal_rems"], "expected catalogueId not found in internal_rems field"