Skip to content

Commit

Permalink
Revert "never hide requests with invalid codes"
Browse files Browse the repository at this point in the history
This reverts commit caf0cac.
  • Loading branch information
elichad committed Nov 20, 2023
1 parent a52b4ec commit 6814b73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
11 changes: 1 addition & 10 deletions amy/extrequests/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down Expand Up @@ -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:
Expand Down
13 changes: 1 addition & 12 deletions amy/extrequests/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 6814b73

Please sign in to comment.