Skip to content

Commit

Permalink
github: handle missing repo license
Browse files Browse the repository at this point in the history
Co-authored-by: Manuel Costa <[email protected]>
  • Loading branch information
slint and alejandromumo committed Dec 4, 2024
1 parent 798bf96 commit 6ac9175
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions site/zenodo_rdm/github/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
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_rdm.github.schemas import CitationMetadataSchema
from zenodo_rdm.legacy.deserializers.schemas import LegacySchema

Expand Down Expand Up @@ -112,7 +111,8 @@ def metadata(self):
)
# Add default license if not yet added
if not output.get("rights"):
output.update(
{"rights": [{"id": metadata.repo_license.lower() or "cc-by-4.0"}]}
)
default_license = "cc-by-4.0"
if metadata.repo_license:
default_license = metadata.repo_license.lower()
output.update({"rights": [{"id": default_license}]})
return output

0 comments on commit 6ac9175

Please sign in to comment.