Skip to content

Commit

Permalink
github: transform gh license to RDM
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandromumo authored and carlinmack committed Dec 9, 2024
1 parent df1cb9e commit 68e1e40
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions site/zenodo_rdm/github/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from invenio_github.errors import CustomGitHubMetadataError
from invenio_rdm_records.services.github.metadata import RDMReleaseMetadata
from invenio_rdm_records.services.github.release import RDMGithubRelease
from zenodo_legacy.licenses import legacy_to_rdm

from zenodo_rdm.github.schemas import CitationMetadataSchema
from zenodo_rdm.legacy.deserializers.schemas import LegacySchema
Expand Down Expand Up @@ -110,10 +111,11 @@ def metadata(self):
]
}
)
# Add default license if not yet added
# Add default license if not yet added
if not output.get("rights"):
default_license = "cc-by-4.0"
if metadata.repo_license:
default_license = metadata.repo_license.lower()
output.update({"rights": [{"id": default_license}]})
rdm_license = legacy_to_rdm(default_license) or default_license
output.update({"rights": [{"id": rdm_license}]})
return output

0 comments on commit 68e1e40

Please sign in to comment.