Skip to content

Commit

Permalink
ror: use datePublished as fallback date for dataset timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Aug 28, 2024
1 parent fcc1557 commit 7b7f661
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion invenio_vocabularies/contrib/common/ror/datastreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ def _get_last_dump_date(self, linksets):
json_ld_reponse.raise_for_status()
json_ld_data = json_ld_reponse.json()

last_dump_date = arrow.get(json_ld_data["dateCreated"])
last_dump_date = arrow.get(
json_ld_data.get("dateCreated")
or json_ld_data.get("datePublished")
)
return last_dump_date
else:
raise ReaderError(
Expand Down
1 change: 1 addition & 0 deletions tests/contrib/common/ror/test_ror_datastreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
API_JSON_RESPONSE_CONTENT_LD_JSON = {
"name": "ROR Data",
"dateCreated": "2024-07-11T22:29:25.727626+00:00",
"datePublished": "2024-07-11T22:29:25.727626+00:00",
}

DOWNLOAD_FILE_BYTES_CONTENT = b"The content of the file"
Expand Down

0 comments on commit 7b7f661

Please sign in to comment.