summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mirrors/models.py1
-rw-r--r--mirrors/views.py2
-rw-r--r--public/views.py2
3 files changed, 3 insertions, 2 deletions
diff --git a/mirrors/models.py b/mirrors/models.py
index 975ead39..da3d8c0d 100644
--- a/mirrors/models.py
+++ b/mirrors/models.py
@@ -116,6 +116,7 @@ class MirrorRsync(models.Model):
class Meta:
verbose_name = 'mirror rsync IP'
+ ordering = ('ip',)
class CheckLocation(models.Model):
diff --git a/mirrors/views.py b/mirrors/views.py
index 6f4ad838..ec056696 100644
--- a/mirrors/views.py
+++ b/mirrors/views.py
@@ -161,7 +161,7 @@ def mirror_details(request, name):
status_info = get_mirror_statuses(mirror_id=mirror.id)
checked_urls = {url for url in status_info['urls'] \
if url.mirror_id == mirror.id}
- all_urls = set(mirror.urls.select_related('protocol'))
+ all_urls = set(mirror.urls.filter(active=True).select_related('protocol'))
# Add dummy data for URLs that we haven't checked recently
other_urls = all_urls.difference(checked_urls)
for url in other_urls:
diff --git a/public/views.py b/public/views.py
index 39273396..24edd044 100644
--- a/public/views.py
+++ b/public/views.py
@@ -80,7 +80,7 @@ def _mirror_urls():
'''In order to ensure this is lazily evaluated since we can't do
sorting at the database level, make it a callable.'''
urls = MirrorUrl.objects.select_related('mirror').filter(
- protocol__default=True,
+ active=True, protocol__default=True,
mirror__public=True, mirror__active=True, mirror__isos=True)
sort_by = attrgetter('country.name', 'mirror.name')
return sorted(urls, key=sort_by)