Skip to content

Commit

Permalink
Merge pull request #251 from opencivicdata/skip-restricted
Browse files Browse the repository at this point in the history
Skip bills with restricted view
  • Loading branch information
reginafcompton authored Oct 17, 2018
2 parents 7fb517c + 0927a20 commit 600a758
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lametro/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def scrape(self, window=28, matter_ids=None) :

n_days_ago = datetime.datetime.utcnow() - datetime.timedelta(float(window))
for matter in matters:
# If this Boolean field is True, then do not scrape the Bill.
# This issue explains why a restricted Bill might appear (unwelcome) in the Legistar API:
# https://github.com/datamade/la-metro-councilmatic/issues/345#issuecomment-421184826
if matter['MatterRestrictViewViaWeb']:
continue

matter_id = matter['MatterId']

date = matter['MatterIntroDate']
Expand Down Expand Up @@ -222,7 +228,6 @@ def scrape(self, window=28, matter_ids=None) :
media_type="application/pdf")

bill.extras = {'local_classification' : matter['MatterTypeName']}
bill.extras = {'restrict_view' : matter['MatterRestrictViewViaWeb']}

text = self.text(matter_id)

Expand Down

0 comments on commit 600a758

Please sign in to comment.