summaryrefslogtreecommitdiff
path: root/public/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'public/views.py')
-rw-r--r--public/views.py41
1 files changed, 22 insertions, 19 deletions
diff --git a/public/views.py b/public/views.py
index 43cc5882..a8e2a001 100644
--- a/public/views.py
+++ b/public/views.py
@@ -5,8 +5,10 @@ from . import utils
from django.contrib.auth.models import User
from django.db.models import Q
+from django.http import Http404
from django.views.generic import list_detail
from django.views.generic.simple import direct_to_template
+from django.shortcuts import redirect
def index(request):
@@ -17,20 +19,28 @@ def index(request):
}
return direct_to_template(request, 'public/index.html', context)
-def userlist(request, type='Developers'):
+USER_LISTS = {
+ 'hackers': {
+ 'user_type': 'Hackers',
+ 'description': "This is a list of the current Parabola Hackers. They maintain the [libre] package repository and keep the [core], [extra] and [community] repositories clean of unfree software, in addition to doing any other developer duties.",
+ },
+ 'fellows': {
+ 'user_type': 'Fellows',
+ 'description': "Below you can find a list of ex-hackers (aka project fellows). These folks helped make Parabola what it is today. Thanks!",
+ },
+}
+
+def userlist(request, type='hackers'):
users = User.objects.order_by('username').select_related('userprofile')
- if type == 'Hackers':
+ if type == 'hackers':
users = users.filter(is_active=True, groups__name="Hackers")
- msg = "This is a list of the current Parabola GNU/Linux hackers. They maintain the *-libre packages in addition to doing any other developer duties."
- elif type == 'Fellows':
- users = users.filter(is_active=False)
- msg = "Below you can find a list of ex-hackers (aka project fellows). These folks helped make Parabola what it is today. Thanks!"
+ elif type == 'fellows':
+ users = users.filter(is_active=False, groups__name__in=["Hackers"])
+ else:
+ raise Http404
- context = {
- 'user_type': type,
- 'description': msg,
- 'users': users,
- }
+ context = USER_LISTS[type].copy()
+ context['users'] = users
return direct_to_template(request, 'public/userlist.html', context)
def donate(request):
@@ -40,14 +50,7 @@ def donate(request):
return direct_to_template(request, 'public/donate.html', context)
def download(request):
- qset = MirrorUrl.objects.select_related('mirror', 'protocol').filter(
- protocol__is_download=True,
- mirror__public=True, mirror__active=True, mirror__isos=True
- )
- return list_detail.object_list(request,
- qset.order_by('mirror__country', 'mirror__name', 'protocol'),
- template_name="public/download.html",
- template_object_name="mirror_url")
+ return redirect('http://wiki.parabolagnulinux.org/get', permanent=True)
def feeds(request):
context = {