summaryrefslogtreecommitdiff
path: root/mirrors/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-02-13 12:34:35 -0600
committerDan McGee <dan@archlinux.org>2012-02-13 12:36:37 -0600
commit3a1101db1d18be2f95342ad8943722eb94ae577e (patch)
tree7399633feb3a406328060833cb6452c7cd67c1b7 /mirrors/views.py
parentfa6f85f127f5f100f98c0ce130cea2277cd02a0e (diff)
Don't select FTP by default in mirrorlists
More generally, add a new 'default' column to the mirror protocol model so we can determine what is selected and shown by default. Signed-off-by: Dan McGee <dan@archlinux.org>
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):