summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2014-10-21 17:32:29 -0500
committerDan McGee <dan@archlinux.org>2014-10-21 17:32:29 -0500
commit69d771978bcf7d70d106c3e704fde203451fd48e (patch)
tree66c23d514189e7097518d2c69e8d00f3af2ddc82
parent9f20cf7c81a38283fa08552f59a149d6abd76516 (diff)
Fix 500 when no URLs have been checkedrelease_2014-10-21
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--mirrors/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mirrors/utils.py b/mirrors/utils.py
index 5685c9c8..51daf50e 100644
--- a/mirrors/utils.py
+++ b/mirrors/utils.py
@@ -128,8 +128,8 @@ def get_mirror_statuses(cutoff=DEFAULT_CUTOFF, mirror_id=None, show_all=False):
if urls:
url_data = status_data(cutoff_time, mirror_id)
urls = [annotate_url(url, url_data.get(url.id, {})) for url in urls]
- last_check = max([u.last_check for u in urls if u.last_check])
- num_checks = max([u.check_count for u in urls])
+ last_check = max([u.last_check for u in urls if u.last_check] or [None])
+ num_checks = max(u.check_count for u in urls)
check_info = MirrorLog.objects.filter(check_time__gte=cutoff_time)
if mirror_id:
check_info = check_info.filter(url__mirror_id=mirror_id)