Skip to content

Commit ade6e50

Browse files
committed
Add date stamp check
1 parent 713d2e7 commit ade6e50

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

caltech_authors_tech_report.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,11 @@ def epxml_to_datacite(eprint):
205205
array.append(obj)
206206
metadata['relatedIdentifiers']=array
207207

208-
#Dates
209-
dates = []
210-
dates.append({"date":eprint['datestamp'],"dateType":"Available"})
211-
metadata['dates'] = dates
208+
#Dates - only if record release date present
209+
if 'datestamp' in eprint:
210+
dates = []
211+
dates.append({"date":eprint['datestamp'],"dateType":"Available"})
212+
metadata['dates'] = dates
212213

213214
return metadata
214215

0 commit comments

Comments
 (0)