summaryrefslogtreecommitdiff
path: root/mirrors/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2014-10-21 20:33:12 -0500
committerDan McGee <dan@archlinux.org>2014-10-21 20:33:12 -0500
commitd009cd0b5c4ba018681942daa59452fe2b1a42c2 (patch)
treefa820a2a78eda16a95acc1598e86c510552436e7 /mirrors/views.py
parent69d771978bcf7d70d106c3e704fde203451fd48e (diff)
Fix error when viewing mirror with no active URLs
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors/views.py')
-rw-r--r--mirrors/views.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mirrors/views.py b/mirrors/views.py
index c2736da8..cffafbf5 100644
--- a/mirrors/views.py
+++ b/mirrors/views.py
@@ -193,6 +193,8 @@ def mirror_details(request, name):
def mirror_details_json(request, name):
authorized = request.user.is_authenticated()
mirror = get_object_or_404(Mirror, name=name)
+ if not authorized and (not mirror.public or not mirror.active):
+ raise Http404
status_info = get_mirror_statuses(mirror_id=mirror.id,
show_all=authorized)
data = status_info.copy()