Commit a1ef8482 authored by Baptiste Jonglez's avatar Baptiste Jonglez

[enh] do not take into account duplicates, ooscope or closed reports for the map

parent f455552c
......@@ -228,7 +228,7 @@ def filter_violations(request, country, operator=None):
def list_violations(request):
violations = Violation.objects.filter(activationid='')
countries=sorted([(i['total'],i['country'])
for i in Violation.objects.values('country').filter(activationid='').annotate(total=Count('country'))],
for i in Violation.objects.values('country').filter(activationid='').exclude(state=['duplicate', 'ooscope', 'closed']).annotate(total=Count('country'))],
reverse=True)
legend=sorted(set([(w, "rgba(255,%d, 00, 0.4)" % (w*768/(countries[0][0]+1)%256)) for w,c in countries]),reverse=True)
countrycolors=json.dumps(dict([(c.lower(),"#ff%02x00" % (w*768/(countries[0][0]+1)%256)) for w,c in countries]))
......
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