diff --git a/.DS_Store b/.DS_Store index 7dbadd9..bb3816e 100755 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app/langchain_orcid2.py b/app/langchain_orcid2.py index fc8d395..8ad5e97 100644 --- a/app/langchain_orcid2.py +++ b/app/langchain_orcid2.py @@ -201,7 +201,10 @@ def published_metadata(doi, cremail, pyalexemail): authors_info = [] for author in r['message']['author']: - full_name = author['given'] + ' ' + author['family'] + if 'given' in author: + full_name = author['given'] + ' ' + author['family'] + else: + full_name = author['name'] authors_info.append(full_name) if authors_info: @@ -211,11 +214,12 @@ def published_metadata(doi, cremail, pyalexemail): refs = [] - for i in r['message']['reference']: - try: - refs.append(i['DOI']) - except: - refs.append(f"{i['key']}, DOI not present") + if 'reference' in r['message']: + for i in r['message']['reference']: + try: + refs.append(i['DOI']) + except: + refs.append(f"{i['key']}, DOI not present") url_link = r['message']['URL']