Skip to content

Commit

Permalink
Merge pull request #88 from spacemansteve/master
Browse files Browse the repository at this point in the history
cleanup code in request_aff_augment
  • Loading branch information
spacemansteve committed Mar 27, 2019
2 parents 04a9371 + 1ececc8 commit 14b8e06
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions adsmp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,14 @@ def request_aff_augment(self, bibcode, data=None):
set data parameter to provide test data"""
if data is None:
rec = self.get_record(bibcode)
aff = rec.get('bib_data', {}).get('aff', None)
author = rec.get('bib_data', {}).get('author', '')
if rec is None:
self.logger.warn('request_aff_augment called but no data at all for bibcode {}'.format(bibcode))
return
bib_data = rec.get('bib_data', None)
if bib_data is None:
self.logger.warn('request_aff_augment called but no bib data for bibcode {}'.format(bibcode))
return
aff = bib_data.get('aff', None)
data = {
'bibcode': bibcode,
"aff": aff,
Expand Down

0 comments on commit 14b8e06

Please sign in to comment.