diff --git a/dear_petition/petition/types/dismissed.py b/dear_petition/petition/types/dismissed.py index 0cbffeba..3dfbdacb 100644 --- a/dear_petition/petition/types/dismissed.py +++ b/dear_petition/petition/types/dismissed.py @@ -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 diff --git a/dear_petition/petition/types/tests/test_dismissed.py b/dear_petition/petition/types/tests/test_dismissed.py index 8675be5c..ba8ba86f 100644 --- a/dear_petition/petition/types/tests/test_dismissed.py +++ b/dear_petition/petition/types/tests/test_dismissed.py @@ -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