summaryrefslogtreecommitdiffstats
path: root/public/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-10-11 19:29:15 -0500
committerDan McGee <dan@archlinux.org>2011-10-11 19:29:15 -0500
commit71e57570c262fffb11ca6e0dc97342119198f740 (patch)
tree3736af12cda316baffbcc4e5ba2a43f41901b847 /public/views.py
parenta01a11cfad84bd44c1f5aeffcc0665bd93889e1d (diff)
downloadarchweb-71e57570c262fffb11ca6e0dc97342119198f740.tar.gz
archweb-71e57570c262fffb11ca6e0dc97342119198f740.zip
Pylint suggested and other cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'public/views.py')
-rw-r--r--public/views.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/public/views.py b/public/views.py
index 821e4d5c..14dd6353 100644
--- a/public/views.py
+++ b/public/views.py
@@ -5,7 +5,6 @@ from . import utils
from django.conf import settings
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
@@ -34,18 +33,18 @@ USER_LISTS = {
},
}
-def userlist(request, type='devs'):
+def userlist(request, user_type='devs'):
users = User.objects.order_by('username').select_related('userprofile')
- if type == 'devs':
+ if user_type == 'devs':
users = users.filter(is_active=True, groups__name="Developers")
- elif type == 'tus':
+ elif user_type == 'tus':
users = users.filter(is_active=True, groups__name="Trusted Users")
- elif type == 'fellows':
+ elif user_type == 'fellows':
users = users.filter(is_active=False, groups__name__in=["Developers", "Trusted Users"])
else:
raise Http404
- context = USER_LISTS[type].copy()
+ context = USER_LISTS[user_type].copy()
context['users'] = users
return direct_to_template(request, 'public/userlist.html', context)