Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter out counties with balances from list added to OSP form #1725

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/backend/expungeservice/form_filling.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,12 @@ def _create_and_write_pdf(

@staticmethod
def counties_with_cases_to_expunge(all_case_results: List[CaseResults]):
counties: List[str] = []
counties_with_eligible_charge: List[str] = []
counties_with_balances: List[str] = []
for case_result in all_case_results:
if case_result.has_eligible_charges and case_result.case.summary.location not in counties:
counties.append(case_result.case.summary.location)
return counties
if case_result.has_eligible_charges and case_result.case.summary.location not in counties_with_eligible_charge:
counties_with_eligible_charge.append(case_result.case.summary.location)
if case_result.case.summary.balance_due_in_cents != 0:
counties_with_balances.append(case_result.case.summary.location)
counties_with_expungements = [county for county in counties_with_eligible_charge if county not in counties_with_balances]
return counties_with_expungements
Loading