diff options
author | 2012-11-27 21:48:33 +0100 | |
---|---|---|
committer | 2012-11-27 21:48:33 +0100 | |
commit | e89edb588e44f52543591e0149d9b266ebd15bbe (patch) | |
tree | 9a8ae44a00e7f0cdf23f1164a9a817acc7fb15e5 | |
parent | euscanwww: Improved query for aggregating handler's data (diff) | |
download | euscan-e89edb588e44f52543591e0149d9b266ebd15bbe.tar.gz euscan-e89edb588e44f52543591e0149d9b266ebd15bbe.tar.bz2 euscan-e89edb588e44f52543591e0149d9b266ebd15bbe.zip |
euscanwww: handle '' handler
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
-rw-r--r-- | euscanwww/djeuscan/views.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/euscanwww/djeuscan/views.py b/euscanwww/djeuscan/views.py index b599d4c..f3e1f8c 100644 --- a/euscanwww/djeuscan/views.py +++ b/euscanwww/djeuscan/views.py @@ -386,12 +386,15 @@ def statistics(request): .annotate(n=models.Count("handler"), avg_conf=models.Avg("confidence")) ) + for i in xrange(len(handlers)): + if not handlers[i]['handler']: + handlers[i]['handler'] = "unknown" return {"handlers": handlers} @render_to("euscan/statistics_handler.html") def statistics_handler(request, handler): - if handler == "None": + if handler == "unknown": handler = "" packages = Package.objects.for_handler(handler) return {"handler": handler, "packages": packages} |