summaryrefslogtreecommitdiffstats
path: root/releng/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-04-17 15:36:33 -0500
committerDan McGee <dan@archlinux.org>2012-04-17 15:36:33 -0500
commitc1ccc88d0769afc16363ceb06e5bdcd8605455bf (patch)
treecb26f846f3e7cd3ed364dc3a51d052df992fe2dd /releng/views.py
parent1fabb8023a0350319bcad09914dfe5640dc34e9b (diff)
downloadarchweb-c1ccc88d0769afc16363ceb06e5bdcd8605455bf.tar.gz
archweb-c1ccc88d0769afc16363ceb06e5bdcd8605455bf.zip
Prune down table rows on ISO testing overview page
This table is getting very long as we have upwards of 210 ISOs in the production database. However, it doesn't make much sense to list ISOs that no longer exist and were never tested, so omit these from the results page if we know this to be the case. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'releng/views.py')
-rw-r--r--releng/views.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/releng/views.py b/releng/views.py
index d8ea59f9..fc81d410 100644
--- a/releng/views.py
+++ b/releng/views.py
@@ -177,12 +177,18 @@ def submit_test_thanks(request):
def iso_overview(request):
isos = Iso.objects.all().order_by('-pk')
- successes = dict(Iso.objects.values_list('pk').filter(test__success=True).annotate(ct=Count('test')))
- failures = dict(Iso.objects.values_list('pk').filter(test__success=False).annotate(ct=Count('test')))
+ successes = dict(Iso.objects.values_list('pk').filter(
+ test__success=True).annotate(ct=Count('test')))
+ failures = dict(Iso.objects.values_list('pk').filter(
+ test__success=False).annotate(ct=Count('test')))
for iso in isos:
iso.successes = successes.get(iso.pk, 0)
iso.failures = failures.get(iso.pk, 0)
+ # only show "useful" rows, currently active ISOs or those with results
+ isos = [iso for iso in isos if
+ iso.active == True or iso.successes > 0 or iso.failures > 0]
+
context = {
'isos': isos
}