Skip to content

Commit

Permalink
github: map license NOASSERTION to other
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandromumo authored and slint committed Dec 6, 2024
1 parent e175a31 commit 72c812b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions invenio_rdm_records/services/github/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 72c812b

Please sign in to comment.