Skip to content

Commit

Permalink
Merge pull request #451 from deardurham/guilty_to_lesser_no_more
Browse files Browse the repository at this point in the history
Dismissing guilty to lesser offenses is no longer allowed
  • Loading branch information
georgehelman authored Jan 4, 2024
2 parents 371ebed + 6759920 commit 0c1db62
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
12 changes: 1 addition & 11 deletions dear_petition/petition/types/dismissed.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,5 @@ def build_query():
methods = Q()
for method in DISMISSED_DISPOSITION_METHODS:
methods |= Q(offense__disposition_method__iexact=method)
guilty_to_lesser = build_guilty_to_lesser_query()
# not_assigned_to_another_petition = Q(petitions__isnull=True)
query = action & methods | guilty_to_lesser # & not_assigned_to_another_petition
return query


def build_guilty_to_lesser_query():
action = Q(action="CHARGED")
method = Q(offense__disposition_method="DISPOSED BY JUDGE")
plea = Q(offense__plea="GUILTY TO LESSER")
query = action & method & plea
query = action & methods
return query
24 changes: 0 additions & 24 deletions dear_petition/petition/types/tests/test_dismissed.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,3 @@ def test_petition_offenses(batch, record1, charged_dismissed_record):
batch=batch,
)
assert charged_dismissed_record in petition.get_all_offense_records()


def test_guilty_to_lesser(batch, record1):
offense = OffenseFactory(
ciprs_record=record1,
jurisdiction=constants.DISTRICT_COURT,
plea="GUILTY TO LESSER",
disposition_method="DISPOSED BY JUDGE",
)

offense_record_charged = OffenseRecordFactory(action="CHARGED", offense=offense)
offense_record_convicted = OffenseRecordFactory(action="CONVICTED", offense=offense)

petition = PetitionFactory(
form_type=constants.DISMISSED,
jurisdiction=record1.jurisdiction,
county=record1.county,
batch=batch,
)

petition_offense_records = petition.get_all_offense_records()

assert offense_record_charged in petition_offense_records
assert offense_record_convicted not in petition_offense_records

0 comments on commit 0c1db62

Please sign in to comment.