Skip to content

Commit

Permalink
Fix the status filter value for EMPTY #659
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Druez <[email protected]>
  • Loading branch information
tdruez committed May 2, 2023
1 parent c04aecd commit 0fd1a82
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions scanpipe/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,17 +302,8 @@ def filter(self, qs, value):


class StatusFilter(django_filters.ChoiceFilter):
# def __init__(self, *args, **kwargs):
# kwargs["choices"] = (
# ("none", "No status"),
# ("any", "Any status"),
# )
# super().__init__(*args, **kwargs)

def filter(self, qs, value):
if value == "none":
return qs.no_status()
elif value == "any":
if value == "any":
return qs.status()
return super().filter(qs, value)

Expand Down Expand Up @@ -398,7 +389,7 @@ def __init__(self, *args, **kwargs):

def get_status_choices(self):
default_choices = [
("none", "No status"),
("_EMPTY_", "No status"),
("any", "Any status"),
]
status_values = (
Expand Down

0 comments on commit 0fd1a82

Please sign in to comment.