From 1564d2a521e1e2172b3c3579ceda86c9aceab47e Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Tue, 28 May 2013 19:36:03 +0200 Subject: [PATCH] Fix some things in groups.views Signed-off-by: Nicolas Iooss --- xnet/groups/views.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xnet/groups/views.py b/xnet/groups/views.py index b825063..271604d 100644 --- a/xnet/groups/views.py +++ b/xnet/groups/views.py @@ -11,24 +11,27 @@ def index(request): 'sidebar': 'list', }) + def home(request, slug): return render(request, 'groups/home.html', { 'group': get_object_or_404(XGroup, short=slug), 'sidebar': 'home', }) + @group_required() def directory(request, group, membership=None): return render(request, 'groups/directory.html', { 'group': group, - 'memberships': group.memberships. \ - filter(state='enabled'). \ - select_related(). \ + 'memberships': group.memberships. + filter(state='enabled'). + select_related(). order_by('level'), 'is_admin': membership.level == Membership.LEVEL_ADMIN, 'sidebar': 'directory', }) + @group_required(level=Membership.LEVEL_ADMIN) -def membership_delete(request, group, to_delete): +def membership_delete(request, group, to_delete, membership=None): pass -- 2.1.4