Skip to content

Commit

Permalink
Change wording to internal_rems for metadata objects
Browse files Browse the repository at this point in the history
  • Loading branch information
lhang committed Dec 11, 2024
1 parent 5c916d0 commit a189a9c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion metadata_backend/api/handlers/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion metadata_backend/helpers/schemas/submission.json
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@
}
}
},
"rems": {
"internal_rems": {
"url": {
"type": "string",
"title": "URL for application to apply access for dataset in REMS"
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/test_publications.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit a189a9c

Please sign in to comment.