diff options
author | Dan McGee <dan@archlinux.org> | 2013-05-11 01:46:55 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2013-05-11 01:46:55 +0200 |
commit | c4d894c85b738df53e8e06e65be48e34572b2f5f (patch) | |
tree | 3805f17e16b6f49fcbe318eb60ac03f0bbec7d84 /mirrors | |
parent | dad70d0d7c70e7973cd9e3960b24e7f9ef883c61 (diff) | |
parent | 8097a1fdeff36fb3db521a3b354ea8bf576869cc (diff) | |
download | archweb-c4d894c85b738df53e8e06e65be48e34572b2f5f.tar.gz archweb-c4d894c85b738df53e8e06e65be48e34572b2f5f.tar.xz |
Merge branch 'mirror-errors'
Diffstat (limited to 'mirrors')
-rw-r--r-- | mirrors/views.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mirrors/views.py b/mirrors/views.py index 73d4029..d1dd9da 100644 --- a/mirrors/views.py +++ b/mirrors/views.py @@ -175,6 +175,7 @@ def mirror_details(request, name): if not request.user.is_authenticated() and \ (not mirror.public or not mirror.active): raise Http404 + error_cutoff = timedelta(days=7) status_info = get_mirror_statuses(mirror_id=mirror.id) checked_urls = {url for url in status_info['urls'] \ @@ -188,9 +189,15 @@ def mirror_details(request, name): setattr(url, attr, None) all_urls = sorted(checked_urls.union(other_urls), key=attrgetter('url')) - return render(request, 'mirrors/mirror_details.html', - {'mirror': mirror, 'urls': all_urls}) + error_logs = get_mirror_errors(mirror_id=mirror.id, cutoff=error_cutoff) + context = { + 'mirror': mirror, + 'urls': all_urls, + 'cutoff': error_cutoff, + 'error_logs': error_logs, + } + return render(request, 'mirrors/mirror_details.html', context) def mirror_details_json(request, name): mirror = get_object_or_404(Mirror, name=name) |