Skip to content

Commit 111cb03

Browse files
authored
Merge pull request #999 from sennetconsortium/maxsibilla/provenance-metadata-fix
Maxsibilla/provenance metadata fix
2 parents 78db144 + 139971f commit 111cb03

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/routes/metadata/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ def get_provenance_metadata(ds_uuid: str):
225225
token = get_token()
226226
entity = get_entity(entity_id=ds_uuid, token=token)
227227

228-
if not equals(entity['entity_type'], Ontology.ops().entities().DATASET):
229-
abort_bad_req(f"Entity with UUID: {ds_uuid} is not of type 'Dataset'")
228+
e = Ontology.ops().entities()
229+
allowed_entity_types = [e.DATASET, "Publication"]
230+
if entity['entity_type'] not in allowed_entity_types:
231+
abort_bad_req(f"Entity with UUID: {ds_uuid} is not of type 'Dataset' or 'Publication'")
230232

231233
metadata_json_object = entity_json_dumps(entity, token, False)
232234
return jsonify(metadata_json_object), 200

0 commit comments

Comments
 (0)