diff --git a/files/scripts/healdata/heal-cedar-data-ingest.py b/files/scripts/healdata/heal-cedar-data-ingest.py index aa432dc98..bd59076c1 100644 --- a/files/scripts/healdata/heal-cedar-data-ingest.py +++ b/files/scripts/healdata/heal-cedar-data-ingest.py @@ -283,7 +283,7 @@ def get_related_studies(serial_num, guid, hostname): ] = cedar_record_other_study_websites # setup citations - doi_citation = mds_res["gen3_discovery"]["study_metadata"].get( + doi_citation = mds_res["gen3_discovery"].get( "doi_citation", "" ) mds_res["gen3_discovery"]["study_metadata"]["citation"][ @@ -312,11 +312,9 @@ def get_related_studies(serial_num, guid, hostname): repository.update( {"repository_study_link": repository_study_link} ) - if ( - repository_citation_additional_text - not in repository_citation - ): - repository_citation += repository_citation_additional_text + if (repository.get("repository_study_link", None) and repository_citation_additional_text + not in repository_citation): + repository_citation += repository_citation_additional_text if len(data_repositories): data_repositories[0] = { **data_repositories[0],