SciPost Code Repository

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

Correct bug in harvest_metadata if citation volume undefined

parent aad8016e
No related branches found
No related tags found
No related merge requests found
......@@ -312,11 +312,13 @@ class Publication(models.Model):
if cit['multiauthors']:
output += ' <em>et al.</em>'
output += (', <em>{{ title_' + str(nr) + ' }}</em>, <br/>'
'{{ journal_abbrev_' + str(nr) + ' }} '
'<strong>{{ volume_' + str(nr) + ' }}</strong>, ')
'{{ journal_abbrev_' + str(nr) + ' }}')
context['title_' + str(nr)] = cit['article_title']
context['journal_abbrev_' + str(nr)] = cit['journal_abbreviation']
context['volume_' + str(nr)] = cit['volume']
if cit['volume']:
context['volume_' + str(nr)] = cit['volume']
output += ' <strong>{{ volume_' + str(nr) + ' }}</strong>'
output += ', '
if cit['first_page']:
output += '{{ first_page_' + str(nr) + ' }}'
context['first_page_' + str(nr)] = cit['first_page']
......
......@@ -757,7 +757,10 @@ def harvest_citedby_links(request, doi_string):
article_title = link.find(prefix + 'journal_cite').find(prefix + 'article_title').text
journal_abbreviation = link.find(prefix + 'journal_cite').find(
prefix + 'journal_abbreviation').text
volume = link.find(prefix + 'journal_cite').find(prefix + 'volume').text
try:
volume = link.find(prefix + 'journal_cite').find(prefix + 'volume').text
except AttibuteError:
volume = None
try:
first_page = link.find(prefix + 'journal_cite').find(prefix + 'first_page').text
except:
......
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