diff options
Diffstat (limited to 'mirrors')
-rw-r--r-- | mirrors/utils.py | 2 | ||||
-rw-r--r-- | mirrors/views.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/mirrors/utils.py b/mirrors/utils.py index 0463247a..a26b19ce 100644 --- a/mirrors/utils.py +++ b/mirrors/utils.py @@ -10,7 +10,7 @@ default_cutoff = datetime.timedelta(hours=24) @cache_function(300) def get_mirror_statuses(cutoff=default_cutoff): cutoff_time = datetime.datetime.utcnow() - cutoff - protocols = MirrorProtocol.objects.exclude(protocol__iexact='rsync') + protocols = list(MirrorProtocol.objects.filter(is_download=True)) # I swear, this actually has decent performance... urls = MirrorUrl.objects.select_related('mirror', 'protocol').filter( mirror__active=True, mirror__public=True, diff --git a/mirrors/views.py b/mirrors/views.py index 34385a98..24ca0324 100644 --- a/mirrors/views.py +++ b/mirrors/views.py @@ -25,7 +25,7 @@ class MirrorlistForm(forms.Form): self.fields['country'].choices = make_choice(mirrors) self.fields['country'].initial = ['Any'] protos = make_choice( - MirrorProtocol.objects.exclude(protocol__iexact='rsync')) + MirrorProtocol.objects.filter(is_download=True)) self.fields['protocol'].choices = protos self.fields['protocol'].initial = [t[0] for t in protos] @@ -45,8 +45,8 @@ def generate_mirrorlist(request): def find_mirrors(request, countries=None, protocols=None, use_status=False): if not protocols: - protocols = MirrorProtocol.objects.exclude( - protocol__iexact='rsync').values_list('protocol', flat=True) + protocols = MirrorProtocol.objects.filter( + is_download=True).values_list('protocol', flat=True) qset = MirrorUrl.objects.select_related().filter( protocol__protocol__in=protocols, mirror__public=True, mirror__active=True, mirror__isos=True |