summaryrefslogtreecommitdiff
path: root/mirrors/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'mirrors/views.py')
-rw-r--r--mirrors/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mirrors/views.py b/mirrors/views.py
index 417e26ee..2ef8654d 100644
--- a/mirrors/views.py
+++ b/mirrors/views.py
@@ -29,8 +29,9 @@ class MirrorlistForm(forms.Form):
self.fields['country'].initial = ['all']
protos = make_choice(
MirrorProtocol.objects.filter(is_download=True))
+ initial = MirrorProtocol.objects.filter(is_download=True, default=True)
self.fields['protocol'].choices = protos
- self.fields['protocol'].initial = [t[0] for t in protos]
+ self.fields['protocol'].initial = [p.protocol for p in initial]
self.fields['ip_version'].initial = ['4']
@csrf_exempt
@@ -48,7 +49,8 @@ def generate_mirrorlist(request):
else:
form = MirrorlistForm()
- return direct_to_template(request, 'mirrors/index.html', {'mirrorlist_form': form})
+ return direct_to_template(request, 'mirrors/index.html',
+ {'mirrorlist_form': form})
def find_mirrors(request, countries=None, protocols=None, use_status=False,
ipv4_supported=True, ipv6_supported=True):