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: handle missing repo license #1085

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
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: 3 additions & 3 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions site/zenodo_rdm/github/release.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

Check failure on line 1 in site/zenodo_rdm/github/release.py

View workflow job for this annotation

GitHub Actions / Python (site, 3.9, postgresql14, opensearch2)

isort-check 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
#
# Copyright (C) 2023 CERN.
#
Expand All @@ -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 @@
)
# 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
Loading