diff options
author | Dan McGee <dan@archlinux.org> | 2010-09-22 00:43:39 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-09-22 00:43:39 +0200 |
commit | 753329659e3edf725881bbfd89d7c25034e41c2f (patch) | |
tree | f094bb20f9709736cb5349dba4ed39e2152d6545 | |
parent | b3883820a249a0bb6ba6237f815b8cdffd630fcd (diff) | |
download | archweb-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.py | 5 |
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 = [] |