Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github: transform gh license to RDM #1086

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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