Skip to content

Commit

Permalink
marcxml: fixed funding
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandromumo authored and zzacharo committed Sep 11, 2023
1 parent 6f2637e commit 59784ea
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions invenio_rdm_records/resources/serializers/marcxml/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,23 +302,25 @@ def _serialize_funder(funding_object):
funder = funding_object["funder"]
award = funding_object.get("award", {})

# TODO what
identifier = award.get("identifiers", [])[0]
scheme = identifier.get("scheme", "null")
identifier_value = identifier.get("identifier", "null")
title = award.get("title", {})
title = list(title.values())[0] if title else "null"
number = award.get("number", "null")
funder_string = ""

if award:
identifier = award.get("identifiers", [])[0]
scheme = identifier.get("scheme", "null")
identifier_value = identifier.get("identifier", "null")
title = award.get("title", {})
title = list(title.values())[0] if title else "null"
number = award.get("number", "null")

funder_string += f"award_identifiers_scheme={scheme}; "
funder_string += f"award_identifiers_identifier={identifier_value}; "
funder_string += f"award_title={title}; "
funder_string += f"award_number={number}; "

funder_id = funder["id"]
funder_name = funder.get("name", "null")

# Serialize funder
funder_string = ""
funder_string += f"award_identifiers_scheme={scheme}; "
funder_string += f"award_identifiers_identifier={identifier_value}; "
funder_string += f"award_title={title}; "
funder_string += f"award_number={number}; "
funder_string += f"funder_id={funder_id}; "
funder_string += f"funder_name={funder_name}; "

Expand Down

0 comments on commit 59784ea

Please sign in to comment.