Skip to content

Commit

Permalink
MT: fix for vote pointing to bad action id (#5227)
Browse files Browse the repository at this point in the history
  • Loading branch information
showerst authored Jan 16, 2025
1 parent 06f0522 commit 1d930b7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions scrapers/mt/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def scrape_votes_page(self, vote_url: str, bill: Bill):
passed = counts["YES"] > counts["NO"]

# regular vs committee votes
if "billStatus" in row:
if "billStatus" in row and row["billStatus"] and "id" in row["billStatus"]:
bill_action = self.actions_by_id[str(row["billStatus"]["id"])]
chamber = (
"lower"
Expand All @@ -490,8 +490,19 @@ def scrape_votes_page(self, vote_url: str, bill: Bill):
== "HOUSE"
else "upper"
)
bill_action = self.actions_by_id[str(row["billStatusId"])]
if str(row["billStatusId"]) in self.actions_by_id:
bill_action = self.actions_by_id[str(row["billStatusId"])]
else:
self.warning(
f"Unable to find bill action {str(row['billStatusId'])}"
)
bill_action = None
when = dateutil.parser.parse(row["voteTime"])
else:
self.error(
f"Found MT vote with neither an action nor a meeting. {vote_url}"
)
continue

when = self.tz.localize(when)
vote_id = f"{bill.legislative_session}-{bill.identifier}-{str(row['id'])}"
Expand Down

0 comments on commit 1d930b7

Please sign in to comment.