From ac7542bf6f27ca6c7ee61a9f3851049b28521e97 Mon Sep 17 00:00:00 2001 From: Alex Ioannidis Date: Mon, 23 Oct 2023 12:45:10 +0200 Subject: [PATCH] legacy: fix grants serialization --- site/zenodo_rdm/legacy/serializers/schemas/common.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/site/zenodo_rdm/legacy/serializers/schemas/common.py b/site/zenodo_rdm/legacy/serializers/schemas/common.py index 0b449db8..3b95e62a 100644 --- a/site/zenodo_rdm/legacy/serializers/schemas/common.py +++ b/site/zenodo_rdm/legacy/serializers/schemas/common.py @@ -268,6 +268,9 @@ def dump_access_right(self, obj): def _grant(self, award, funder): """Serialize an RDM award and funder into a legacy Zenodo grant.""" + # RDM allows specifying only funder + if not award: + return funder_id = funder.get("id") funder_id = FUNDER_ROR_TO_DOI.get(funder_id, funder_id) award_number = award.get("number")