From 753329659e3edf725881bbfd89d7c25034e41c2f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 21 Sep 2010 17:43:39 -0500 Subject: Prevent 500 if no mirror checks have ran Signed-off-by: Dan McGee --- mirrors/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mirrors') diff --git a/mirrors/views.py b/mirrors/views.py index 59d6337b..b13c9148 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 = [] -- cgit v1.2.3-54-g00ecf