diff --git a/amy/extrequests/filters.py b/amy/extrequests/filters.py index b11f3bb39..2ebc636df 100644 --- a/amy/extrequests/filters.py +++ b/amy/extrequests/filters.py @@ -74,7 +74,7 @@ def __init__(self, data=None, *args, **kwargs): invalid_member_code = django_filters.BooleanFilter( label="Member code marked as invalid", - method="filter_member_code_override", + field_name="member_code_override", widget=widgets.CheckboxInput, ) @@ -164,15 +164,6 @@ def filter_non_null_manual_score(self, queryset, name, manual_score): return queryset.filter(score_manual__isnull=False) return queryset - def filter_member_code_override( - self, queryset: QuerySet, name: str, only_overrides: bool - ) -> QuerySet: - """If checked, only show requests where the member code has been - marked as invalid. Otherwise, show all requests.""" - if only_overrides: - return queryset.filter(member_code_override=True) - return queryset - def filter_eventbrite_id( self, queryset: QuerySet, name: str, value: str ) -> QuerySet: diff --git a/amy/extrequests/tests/test_filters.py b/amy/extrequests/tests/test_filters.py index cc1c6e52c..eb76464be 100644 --- a/amy/extrequests/tests/test_filters.py +++ b/amy/extrequests/tests/test_filters.py @@ -276,7 +276,7 @@ def test_filter_nonnull_manual_score(self): # Assert self.assertQuerysetEqual(result, [self.request_blackwidow]) - def test_filter_invalid_member_code__true(self): + def test_filter_invalid_member_code(self): # Arrange filter_name = "invalid_member_code" value = True @@ -287,17 +287,6 @@ def test_filter_invalid_member_code__true(self): # Assert self.assertQuerysetEqual(result, [self.request_blackwidow]) - def test_filter_invalid_member_code__false(self): - # Arrange - filter_name = "invalid_member_code" - value = False - - # Act - result = self.filterset.filters[filter_name].filter(self.qs, value) - - # Assert - self.assertQuerysetEqual(result, TrainingRequest.objects.all()) - def test_filter_affiliation(self): # Arrange name = "affiliation"