SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 99f5cf84 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Make update_citedby more robust

parent 1ced2c0e
No related branches found
No related tags found
No related merge requests found
...@@ -102,12 +102,17 @@ def update_citedby(doi_label): ...@@ -102,12 +102,17 @@ def update_citedby(doi_label):
citation['isbn'] = link_el.find(prefix + 'isbn').text citation['isbn'] = link_el.find(prefix + 'isbn').text
multiauthors = False multiauthors = False
for author in link_el.find(prefix + 'contributors').iter(prefix + 'contributor'): if link_el.find(prefix + 'contributors') is not None:
if author.get('sequence') == 'first': for author in link_el.find(prefix + 'contributors').iter(prefix + 'contributor'):
citation['first_author_given_name'] = author.find(prefix + 'given_name').text if author.get('sequence') == 'first':
citation['first_author_surname'] = author.find(prefix + 'surname').text citation['first_author_given_name'] = author.find(prefix + 'given_name').text
else: citation['first_author_surname'] = author.find(prefix + 'surname').text
multiauthors = True else:
multiauthors = True
else:
citation['first_author_given_name'] = ''
citation['first_author_surname'] = '[undetermined]'
citation['multiauthors'] = multiauthors citation['multiauthors'] = multiauthors
citations.append(citation) citations.append(citation)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment