Skip to content

Commit

Permalink
Allow for DC bills without sponsor info
Browse files Browse the repository at this point in the history
  • Loading branch information
showerst committed Oct 18, 2016
1 parent e8c3dd7 commit d68da69
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion openstates/dc/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def scrape(self, session, chambers):
while len(data) > 0:

for bill in data:

bill_versions = [] #sometimes they're in there more than once, so we'll keep track

bill_id = bill["Title"]
Expand All @@ -76,12 +77,18 @@ def scrape(self, session, chambers):
bill = Bill(session,"upper", bill_id, title, type=bill_type)

#sponsors and cosponsors
introducers = legislation_info["Introducer"]
try:
#sometimes there are sponsors, sometimes not.
introducers = legislation_info["Introducer"]
except KeyError:
introducers = []

try:
#sometimes there are cosponsors, sometimes not.
cosponsors = legislation_info["CoSponsor"]
except KeyError:
cosponsors = []

for i in introducers:
sponsor_name = i["Name"]
#they messed up Phil Mendelson's name
Expand Down

0 comments on commit d68da69

Please sign in to comment.