summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-09-22 00:43:39 +0200
committerDan McGee <dan@archlinux.org>2010-09-22 00:43:39 +0200
commit753329659e3edf725881bbfd89d7c25034e41c2f (patch)
treef094bb20f9709736cb5349dba4ed39e2152d6545
parentb3883820a249a0bb6ba6237f815b8cdffd630fcd (diff)
downloadarchweb-753329659e3edf725881bbfd89d7c25034e41c2f.tar.gz
archweb-753329659e3edf725881bbfd89d7c25034e41c2f.tar.xz
Prevent 500 if no mirror checks have ran
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--mirrors/views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mirrors/views.py b/mirrors/views.py
index 59d6337..b13c914 100644
--- a/mirrors/views.py
+++ b/mirrors/views.py
@@ -78,7 +78,10 @@ def status(request):
error_count=Count('error'), last_occurred=Max('check_time')
).order_by('-last_occurred', '-error_count')
- last_check = max([u.last_check for u in urls])
+ if urls:
+ last_check = max([u.last_check for u in urls])
+ else:
+ last_check = None
good_urls = []
bad_urls = []