Skip to content

Commit acae8f8

Browse files
committed
Fix doi bug
1 parent 87c72e3 commit acae8f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

caltech_thesis.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ def cleanhtml(raw_html):
4747
metadata['publicationYear'] = eprint['date']
4848
metadata['resourceType']={"resourceType":\
4949
"Dissertation ("+eprint['thesis_degree']+")",'resourceTypeGeneral':"Text"}
50-
metadata['identifier'] = {'identifier':eprint['doi'],'identifierType':"DOI"}
50+
51+
if 'doi' in eprint:
52+
metadata['identifier'] = {'identifier':eprint['doi'],'identifierType':"DOI"}
53+
5154
metadata['descriptions'] =[{'descriptionType':"Abstract",\
5255
'description':cleanhtml(eprint['abstract'])}]
5356
metadata['formats'] = ['PDF']

0 commit comments

Comments
 (0)