Skip to content

Commit

Permalink
awards: rollback to use the 2nd part of funding stream as program
Browse files Browse the repository at this point in the history
  • Loading branch information
ptamarit committed Oct 14, 2024
1 parent 0903904 commit 946be1e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion invenio_vocabularies/contrib/awards/datastreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ def apply(self, stream_entry, **kwargs):

funding = next(iter(record.get("funding", [])), None)
if funding:
program = funding.get("fundingStream", {}).get("id", "")
funding_stream_id = funding.get("fundingStream", {}).get("id", "")
# Example funding stream ID: `EC::HE::HORIZON-AG-UN`. We need the `HE`
# string, i.e. the second "part" of the identifier.
program = next(iter(funding_stream_id.split("::")[1:2]), "")
if program:
award["program"] = program

Expand Down

0 comments on commit 946be1e

Please sign in to comment.