From 7088440dd5d795c7ac9d9d3deaad6c172cefee21 Mon Sep 17 00:00:00 2001 From: Tim Showers Date: Tue, 29 Nov 2016 11:27:45 -0500 Subject: [PATCH] More changes to remove reliance on mongodb in ny --- openstates/ny/bills.py | 1 + openstates/ny/models.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openstates/ny/bills.py b/openstates/ny/bills.py index 9235924f88..5927633c52 100644 --- a/openstates/ny/bills.py +++ b/openstates/ny/bills.py @@ -294,6 +294,7 @@ def scrape(self, session, chambers): for term in reversed(self.metadata['terms']): if session in term['sessions']: self.term_start_year = term['start_year'] + break for bill in self._generate_bills(session): bill_object = self._scrape_bill(session, bill) diff --git a/openstates/ny/models.py b/openstates/ny/models.py index 8fd1c0dcba..7c28174f76 100644 --- a/openstates/ny/models.py +++ b/openstates/ny/models.py @@ -32,11 +32,11 @@ def __init__(self, scraper, session, bill, details): self.bill_id = bill_id # This works on the assumption that the metadata term ID is # only the start year. - for term in reversed(self.metadata['terms']): + for term in reversed(scraper.metadata['terms']): if session in term['sessions']: self.term_start_year = term['start_year'] break - + self.letter, self.number, self.version = bill_id_parts self.shared_url = 'http://assembly.state.ny.us/leg/?default_fld='\ '&bn={}&term={}'.format(self.bill_id, self.term_start_year)