Skip to content

Commit

Permalink
added empty string handling for candidate (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
LJTrent authored Sep 17, 2019
1 parent 7209e38 commit a21fcf6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/namex/analytics/solr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,4 +1089,6 @@ def keep_phonetic_match(cls, word, query):
@classmethod
def keep_candidate(cls, candidate, name, names):
if len([doc['id'] for doc in names if doc['id'] == candidate['id']]) == 0:
names.append({'name': name, 'id': candidate['id'], 'source': candidate['source'], 'jurisdiction': candidate['jurisdiction'],'start_date': candidate['start_date'] })
names.append({'name': name, 'id': candidate['id'], 'source': candidate['source'],
'jurisdiction': candidate.get('jurisdiction', ''),
'start_date': candidate.get('start_date', '')})

0 comments on commit a21fcf6

Please sign in to comment.