From d7268a24220335db4610f1cb55aeb3f8fa3dfe26 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin@piware.de>
Date: Mon, 9 Jan 2017 10:51:41 +0100
Subject: [PATCH] webcontrol statistics: Fix crash o missing numpkgs
We don't set numpkgs if there is only one result for a particular
architecture, so test for that instead of numpkgspass (which we always
set).
---
webcontrol/templates/browse-statistics.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/webcontrol/templates/browse-statistics.html b/webcontrol/templates/browse-statistics.html
index 337e0c9..43c04e2 100644
--- a/webcontrol/templates/browse-statistics.html
+++ b/webcontrol/templates/browse-statistics.html
@@ -28,7 +28,7 @@
<tr>
<th>pass rate</th>
{% for arch in release_arches[r]|sort %}
- <td>{% if data[r][arch]['numpkgspass'] %}
+ <td>{% if data[r][arch]['numpkgs'] %}
{{'%.1f' % (data[r][arch]['numpkgspass'] * 100 / data[r][arch]['numpkgs'])}}%
{% endif %}</td>
{% endfor %}
--
2.9.3