Changeset 243437e


Ignore:
Timestamp:
Aug 15, 2011, 12:50:47 AM (14 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage, test-hooks
Children:
386ea2a
Parents:
6032bec
git-author:
Alex Dehnert <adehnert@…> (08/15/11 00:50:47)
git-committer:
Alex Dehnert <adehnert@…> (08/15/11 00:50:47)
Message:

Add login link to homepage "no groups" message

Location:
asadb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/views.py

    r6032bec r243437e  
    3636        current_officers = groups.models.OfficeHolder.current_holders.filter(person=username)
    3737        users_groups = groups.models.Group.objects.filter(officeholder__in=current_officers).distinct()
    38         if len(users_groups) == 0:
    39             groupmsg = "You do not currently appear to be listed with any groups."
    4038
    4139        perms = []
     
    4846            if request.user.has_perm('groups.%s' % (perm_name, )):
    4947                has_perms.append((perm_name, perm_desc, ))
    50     else:
    51         groupmsg = "Log in to see the groups that you are listed with."
     48
    5249    context = {
    5350        'groups': users_groups,
  • asadb/template/index.html

    r33b19c3 r243437e  
    1717<h2>My Groups</h2>
    1818
    19 {% if groupmsg %}
    20 <p>{{groupmsg}}</p>
     19{% if user.is_anonymous %}
     20<p><a href='{% url login %}'>Login</a> to see your groups.</p>
     21{% else %}
     22{%if not groups %}
     23<p>You do not currently appear to be listed with any groups.</p>
     24{% endif %}
    2125{% endif %}
    2226
Note: See TracChangeset for help on using the changeset viewer.