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):
queryset = Violation.objects.exclude(old=True)
if 'operator' in self.kwargs:
# If i Have operator I have a country
queryset = Violation.objects.filter(activationid='',
country=self.kwargs['country'],
operator_ref__name=self.kwargs['operator']).exclude(old=True)
queryset = Violation.objects.filter(country=self.kwargs['country'],
operator_ref__name=self.kwargs['operator'])
if 'country' in self.kwargs:
queryset = Violation.objects.filter(activationid='',
country=self.kwargs['country']).exclude(old=True)
queryset = Violation.objects.filter(country=self.kwargs['country'])
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
def get_context_data(self, **kwargs):
......
Markdown is supported
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