From 6814b734aa2b276dc557e6bdbcfacf6ec11b6a02 Mon Sep 17 00:00:00 2001 From: Eli Chadwick Date: Fri, 10 Nov 2023 12:32:11 +0000 Subject: [PATCH] Revert "never hide requests with invalid codes" This reverts commit caf0cac8949eedfbbf9b099f168757ff633bc99a. --- amy/extrequests/filters.py | 11 +---------- amy/extrequests/tests/test_filters.py | 13 +------------ 2 files changed, 2 insertions(+), 22 deletions(-) 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"