From e00f1773d5b03b3e955d57005fab1f8bdf3b37d1 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Wed, 4 Dec 2024 16:37:45 +0100 Subject: [PATCH] github: handle missing repo license --- invenio_rdm_records/services/github/release.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/invenio_rdm_records/services/github/release.py b/invenio_rdm_records/services/github/release.py index 31a0e0818..83772f1bc 100644 --- a/invenio_rdm_records/services/github/release.py +++ b/invenio_rdm_records/services/github/release.py @@ -64,9 +64,10 @@ 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 def get_custom_fields(self):