diff options
author | Johannes Krampf <johannes.krampf@gmail.com> | 2011-11-26 14:27:45 +0100 |
---|---|---|
committer | Johannes Krampf <johannes.krampf@gmail.com> | 2011-11-26 14:27:45 +0100 |
commit | 56c773b32fc68639eb55666b6cfaa32bc9618321 (patch) | |
tree | dcc047f0552224facb6d05cddf2fb72b973bd683 /public | |
parent | fbd23db51b7160a308cd88e407e676994eb08b10 (diff) | |
parent | 85657db05d7f65604340699cfcb9967c9e81a0ef (diff) |
Merged with archweb trunk
Diffstat (limited to 'public')
-rw-r--r-- | public/utils.py | 2 | ||||
-rw-r--r-- | public/views.py | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/public/utils.py b/public/utils.py index 5900c674..30c76ac1 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 a8e2a001..1aae2846 100644 --- a/public/views.py +++ b/public/views.py @@ -3,18 +3,18 @@ from mirrors.models import MirrorUrl from news.models import News 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.shortcuts import redirect from django.views.generic import list_detail from django.views.generic.simple import direct_to_template -from django.shortcuts import redirect def index(request): pkgs = utils.get_recent_updates() context = { - 'news_updates': News.objects.order_by('-postdate', '-id')[:10], + 'news_updates': News.objects.order_by('-postdate', '-id')[:15], 'pkg_updates': pkgs, } return direct_to_template(request, 'public/index.html', context) @@ -30,16 +30,16 @@ USER_LISTS = { }, } -def userlist(request, type='hackers'): +def userlist(request, user_type='hackers'): users = User.objects.order_by('username').select_related('userprofile') - if type == 'hackers': + if user_type == 'hackers': users = users.filter(is_active=True, groups__name="Hackers") - elif type == 'fellows': + elif user_type == 'fellows': users = users.filter(is_active=False, groups__name__in=["Hackers"]) 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) |