summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-10-12 02:29:15 +0200
committerDan McGee <dan@archlinux.org>2011-10-12 02:29:15 +0200
commit71e57570c262fffb11ca6e0dc97342119198f740 (patch)
tree3736af12cda316baffbcc4e5ba2a43f41901b847 /public
parenta01a11cfad84bd44c1f5aeffcc0665bd93889e1d (diff)
downloadarchweb-71e57570c262fffb11ca6e0dc97342119198f740.tar.gz
archweb-71e57570c262fffb11ca6e0dc97342119198f740.tar.xz
Pylint suggested and other cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'public')
-rw-r--r--public/utils.py2
-rw-r--r--public/views.py11
2 files changed, 6 insertions, 7 deletions
diff --git a/public/utils.py b/public/utils.py
index 5900c67..30c76ac 100644
--- a/public/utils.py
+++ b/public/utils.py
@@ -1,6 +1,6 @@
from operator import attrgetter
-from main.models import Arch, Package, Repo
+from main.models import Arch, Package
from main.utils import cache_function, groupby_preserve_order, PackageStandin
class RecentUpdate(object):
diff --git a/public/views.py b/public/views.py
index 821e4d5..14dd635 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)