From bb70b4417eaacfb72a33e54debd3122f710c3447 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 10 Jan 2011 16:35:07 +0000 Subject: [PATCH] Fixed groups, you can't leave them --- groups/views.py | 3 ++- templates/groups/group_list.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/groups/views.py b/groups/views.py index d0bc25e..dbf6616 100644 --- a/groups/views.py +++ b/groups/views.py @@ -50,7 +50,8 @@ def group_list(request): else: requestable = False - group_list.append((group.id, group.name, status, requestable)) + fixed = not group.groupinformation.type == GROUP_TYPE_PERMISSION + group_list.append((group.id, group.name, status, requestable, fixed)) return render_to_response('groups/group_list.html', locals(), context_instance=RequestContext(request)) diff --git a/templates/groups/group_list.html b/templates/groups/group_list.html index e8a7c15..832740a 100644 --- a/templates/groups/group_list.html +++ b/templates/groups/group_list.html @@ -9,11 +9,11 @@ {% if group_list %} -{% for id, group, status, requestable in group_list %} +{% for id, group, status, requestable, fixed in group_list %} {% endfor %}
Group NameStatusActions
{{ group }} {{ status }} {% ifequal status None %}{% if requestable %}Request Membership{% endif %}{% endifequal %} - {% if status == 'Member' or status == 'Admin' %}Leave {% endif %} + {% if status == 'Member' or status == 'Admin' and fixed != True %}Leave {% endif %} {% if status == 'Admin' or request.user.is_superuser %}Admin{% endif %}