euscanwww: handle '' handler

Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
This commit is contained in:
Corentin Chary 2012-11-27 21:48:33 +01:00
parent 3f47a08a54
commit e89edb588e

View File

@ -386,12 +386,15 @@ def statistics(request):
.annotate(n=models.Count("handler"), .annotate(n=models.Count("handler"),
avg_conf=models.Avg("confidence")) avg_conf=models.Avg("confidence"))
) )
for i in xrange(len(handlers)):
if not handlers[i]['handler']:
handlers[i]['handler'] = "unknown"
return {"handlers": handlers} return {"handlers": handlers}
@render_to("euscan/statistics_handler.html") @render_to("euscan/statistics_handler.html")
def statistics_handler(request, handler): def statistics_handler(request, handler):
if handler == "None": if handler == "unknown":
handler = "" handler = ""
packages = Package.objects.for_handler(handler) packages = Package.objects.for_handler(handler)
return {"handler": handler, "packages": packages} return {"handler": handler, "packages": packages}