Skip to content

Commit

Permalink
Don't try and parse empty date attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed Dec 4, 2019
1 parent 84e903e commit bc8ef96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion viringo/services/datacite.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def build_metadata(data):
result.publication_year = data['attributes'].get('publicationYear') or ''

result.dates = [
{'type': date['dateType'], 'date': date['date']} for date in data['attributes']['dates']
{'type': date['dateType'], 'date': date['date']} for date in data['attributes']['dates'] if date.get('date')
] if data['attributes']['dates'] is not None else []

result.contributors = data['attributes'].get('contributors') or []
Expand Down

0 comments on commit bc8ef96

Please sign in to comment.