Skip to content

Commit

Permalink
#115: added handler for sync bill error
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarus1331 committed May 7, 2019
1 parent 23e7ea7 commit 5c8264e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/influencetx/openstates/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def deserialize_subject_tags(subject_list):
]

def find_legislator_by_last_name(chamber, name):
# LOG.warn(f"Finding Legislator: {name}, in {chamber}")
try:
legislator = Legislator.objects.get(
chamber=chamber,
Expand All @@ -154,7 +155,10 @@ def find_legislator_by_last_name(chamber, name):
)
except:
legislator = None

except Legislator.MultipleObjectsReturned:
legislator = None
LOG.warn(f"too many: {name}, in {chamber}")

return legislator


Expand Down

0 comments on commit 5c8264e

Please sign in to comment.