Skip to content

Commit

Permalink
Fee written as 0.00 instead of None if there are eligible convictions. (
Browse files Browse the repository at this point in the history
  • Loading branch information
wittejm authored Dec 1, 2020
1 parent 8fc0a96 commit 3aa9ec5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
13 changes: 3 additions & 10 deletions src/backend/expungeservice/record_summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,14 @@ def get_label(charge: Charge):

@staticmethod
def _build_no_fees_reason(charges):
reason = "no eligible cases" # reason only applies if feeless
reason = "None (no eligible cases)"
if charges:
charges_will_be_eligible = [
c
for c in charges
if c.expungement_result.charge_eligibility.status == ChargeEligibilityStatus.WILL_BE_ELIGIBLE
]
nonconvictions_eligible_now = [
c
for c in charges
if c.expungement_result.charge_eligibility.status == ChargeEligibilityStatus.ELIGIBLE_NOW
and c.disposition.status != DispositionStatus.CONVICTED
]
if charges_will_be_eligible:
reason = "no convictions eligible now"
elif nonconvictions_eligible_now:
reason = "no eligible convictions"
if nonconvictions_eligible_now:
reason = "$0.00 (no eligible convictions)"
return reason
2 changes: 1 addition & 1 deletion src/backend/tests/models/test_record_summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ def test_record_summarizer_no_cases():
assert record_summary.county_fines == []
assert record_summary.eligible_charges_by_date == {}
assert record_summary.county_filing_fees == []
assert record_summary.no_fees_reason == "no eligible cases"
assert record_summary.no_fees_reason == "None (no eligible cases)"
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class CountyFines extends React.Component<Props> {
</span>
</div>
) : (
<span>{`None (${this.props.no_fees_reason})`}</span>
<span>{this.props.no_fees_reason}</span>
)}
</div>
);
Expand Down

0 comments on commit 3aa9ec5

Please sign in to comment.