Skip to content

Commit

Permalink
inspire_api: tolerate missing legacy_creation_date
Browse files Browse the repository at this point in the history
* Closes #828.
  • Loading branch information
GraemeWatt committed Oct 29, 2024
1 parent c51828b commit d9440aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hepdata/modules/inspire_api/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def updated_parsed_content_for_thesis(content, parsed_content):
if 'date' in content['metadata']['thesis_info'].keys():
parsed_content['year'] = content['metadata']['thesis_info']['date']
if parsed_content['year'] is not None:
if content['metadata']['legacy_creation_date'][:4] == parsed_content['year']:
if ('legacy_creation_date' in content['metadata'].keys() and
content['metadata']['legacy_creation_date'][:4] == parsed_content['year']):
parsed_content['creation_date'] = content['metadata']['legacy_creation_date']
else:
parsed_content['creation_date'] = expand_date(parsed_content['year'])
Expand Down

0 comments on commit d9440aa

Please sign in to comment.