Commit 8de6ed62 authored by Okhin's avatar Okhin
Browse files

Double exclusion on old (True AND False is False, bool said)

parent 8d2c1946
...@@ -217,14 +217,12 @@ class ViolationsList(ListView): ...@@ -217,14 +217,12 @@ class ViolationsList(ListView):
queryset = Violation.objects.exclude(old=True) queryset = Violation.objects.exclude(old=True)
if 'operator' in self.kwargs: if 'operator' in self.kwargs:
# If i Have operator I have a country # If i Have operator I have a country
queryset = Violation.objects.filter(activationid='', queryset = Violation.objects.filter(country=self.kwargs['country'],
country=self.kwargs['country'], operator_ref__name=self.kwargs['operator'])
operator_ref__name=self.kwargs['operator']).exclude(old=True)
if 'country' in self.kwargs: if 'country' in self.kwargs:
queryset = Violation.objects.filter(activationid='', queryset = Violation.objects.filter(country=self.kwargs['country'])
country=self.kwargs['country']).exclude(old=True)
if 'all' not in self.request.GET: if 'all' not in self.request.GET:
queryset = queryset.exclude(state__in=['ooscope', 'duplicate', 'closed']).exclude(old=False) queryset = queryset.exclude(state__in=['ooscope', 'duplicate', 'closed'])
return queryset return queryset
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment