Skip to content

Commit 547e9d3

Browse files
Merge branch 'DeSci-md:main' into develop
2 parents d96990a + 3f77708 commit 547e9d3

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.DS_Store

0 Bytes
Binary file not shown.

app/langchain_orcid2.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@ def published_metadata(doi, cremail, pyalexemail):
201201
authors_info = []
202202

203203
for author in r['message']['author']:
204-
full_name = author['given'] + ' ' + author['family']
204+
if 'given' in author:
205+
full_name = author['given'] + ' ' + author['family']
206+
else:
207+
full_name = author['name']
205208
authors_info.append(full_name)
206209

207210
if authors_info:
@@ -211,11 +214,12 @@ def published_metadata(doi, cremail, pyalexemail):
211214

212215

213216
refs = []
214-
for i in r['message']['reference']:
215-
try:
216-
refs.append(i['DOI'])
217-
except:
218-
refs.append(f"{i['key']}, DOI not present")
217+
if 'reference' in r['message']:
218+
for i in r['message']['reference']:
219+
try:
220+
refs.append(i['DOI'])
221+
except:
222+
refs.append(f"{i['key']}, DOI not present")
219223

220224
url_link = r['message']['URL']
221225

0 commit comments

Comments
 (0)