Skip to content

Commit

Permalink
Merge pull request #73 from ehenneken/eprint_figure_label
Browse files Browse the repository at this point in the history
no empty labels
  • Loading branch information
ehenneken committed Nov 15, 2016
2 parents db668a9 + cd739f3 commit bdc4e17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion service/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_graphics(bibcode):
else:
results = {
'query': 'failed', 'error': 'PostgreSQL problem (%s)' % err}
print results

if results and 'figures' in results:
if len(results['figures']) == 0:
# There are cases where an entry exists, but the 'figures'
Expand Down
4 changes: 3 additions & 1 deletion service/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,9 @@ def manage_arXiv_graphics(ft_file, bibcode, arx_id, category, update=False, dryr
try:
fig_data['figure_label'] = item[2].encode('ascii','ignore')
except:
fig_data['figure_label'] = ''
fig_data['figure_label'] = ''
if not fig_data['figure_label']:
fig_data['figure_label'] = 'figure %s' % fid
try:
fig_data['figure_caption'] = item[1].encode('ascii','ignore')
except:
Expand Down

0 comments on commit bdc4e17

Please sign in to comment.