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)