From 72c812bbf99988a9e70065f50e03c868e801a35d Mon Sep 17 00:00:00 2001 From: alejandromumo Date: Fri, 6 Dec 2024 10:53:40 +0100 Subject: [PATCH] github: map license NOASSERTION to other --- invenio_rdm_records/services/github/metadata.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/invenio_rdm_records/services/github/metadata.py b/invenio_rdm_records/services/github/metadata.py index 2a64ddbd9..b6e0d438a 100644 --- a/invenio_rdm_records/services/github/metadata.py +++ b/invenio_rdm_records/services/github/metadata.py @@ -80,9 +80,15 @@ def default_metadata(self): @property def repo_license(self): - """Get license from repository, if any. Falls back to default.""" + """Get license from repository, if any.""" repo_license_obj = self.rdm_release.repository_payload.get("license", {}) - return repo_license_obj.get("spdx_id") if repo_license_obj else None + if not repo_license_obj: + return None + spdx_id = repo_license_obj.get("spdx_id") + # For 'other' type of licenses, Github sets the spdx_id to NOASSERTION + if spdx_id == "NOASSERTION": + spdx_id = "other" + return spdx_id @property def contributors(self):