summaryrefslogtreecommitdiff
path: root/mirrors
diff options
context:
space:
mode:
Diffstat (limited to 'mirrors')
-rw-r--r--mirrors/views.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/mirrors/views.py b/mirrors/views.py
index a2b94de8..032a4700 100644
--- a/mirrors/views.py
+++ b/mirrors/views.py
@@ -104,10 +104,19 @@ def mirror_details(request, name):
mirror = get_object_or_404(Mirror, name=name)
if not request.user.is_authenticated() and \
(not mirror.public or not mirror.active):
- # TODO: maybe this should be 403? but that would leak existence
raise Http404
+
+ status_info = get_mirror_statuses()
+ checked_urls = [url for url in status_info['urls'] \
+ if url.mirror_id == mirror.id]
+ all_urls = mirror.urls.select_related('protocol')
+ # get each item from checked_urls and supplement with anything in all_urls
+ # if it wasn't there
+ all_urls = set(checked_urls).union(all_urls)
+ all_urls = sorted(all_urls, key=lambda x: x.url)
+
return direct_to_template(request, 'mirrors/mirror_details.html',
- {'mirror': mirror})
+ {'mirror': mirror, 'urls': all_urls})
def status(request):
bad_timedelta = datetime.timedelta(days=3)