Skip to content

Commit

Permalink
DC: Add support for bill introducers
Browse files Browse the repository at this point in the history
  • Loading branch information
zstumgoren committed Dec 1, 2016
1 parent 7088440 commit 003c7db
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions openstates/dc/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,25 @@ def scrape(self, session, chambers):
bill = Bill(session,"upper", bill_id, title, type=bill_type)

#sponsors and cosponsors
try:
#sometimes there are sponsors, sometimes not.
if "Introducer" in legislation_info:
introducers = legislation_info["Introducer"]
except KeyError:
intro_date = self.date_format(legislation_info["IntroductionDate"])
bill.add_action("upper",
"Introduced",
intro_date,
type="bill:introduced")
else:
#sometimes there are introducers, sometimes not.
# Set Introducers to empty array to avoid downstream breakage, but log bills without introducers
self.logger.warning("No Introducer: {0} {1}: {2}".format(bill['chamber'], bill['session'], bill['bill_id']))
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 003c7db

Please sign in to comment.