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):