Skip to content

Commit d7618ce

Browse files
committed
An improved handling of the 'no active roles' message.
- Legacy-Id: 14207
1 parent dfaf5a5 commit d7618ce

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

ietf/group/templatetags/group_filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ def has_sessions(group,num):
88

99
@register.filter
1010
def active_roles(queryset):
11-
return queryset.filter(state_id='active').exclude(group__acronym='secretariat')
11+
return queryset.filter(group__state_id__in=['active', 'bof']).exclude(group__acronym='secretariat')
1212

ietf/templates/person/profile.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{% load markup_tags %}
55
{% load staticfiles %}
66
{% load ietf_filters %}
7+
{% load group_filters %}
78

89
{% block title %}Profile for {{ persons.0 }}{% endblock %}
910

@@ -37,10 +38,7 @@ <h1>{{ person.name }} {% if person.ascii != person.name %}<br><small>({{person.a
3738
{% if person.role_set.exists %}
3839
<h2 id="roles">Roles</h2>
3940
<table class="table">
40-
{% if person.role_set.count %}
41-
{% for role in person.role_set.all %}
42-
{% if role.group.state_id == 'active' or role.group.state_id == 'bof' %}
43-
{% if role.group.acronym != 'secretariat' %}
41+
{% for role in person.role_set.all|active_roles %}
4442
<tr>
4543
<td>
4644
{{ role.name.name }}
@@ -52,12 +50,9 @@ <h2 id="roles">Roles</h2>
5250
<a href="mailto:{{role.email.address}}">{{ role.email.address }}</a>
5351
</td>
5452
</tr>
55-
{% endif %}
56-
{% endif %}
53+
{% empty %}
54+
{{ person.first_name }} has no active roles as of {{ today }}.
5755
{% endfor %}
58-
{% else %}
59-
{{ person.first_name }} has no active roles as of {{ today }}.
60-
{% endif %}
6156
</table>
6257
{% endif %}
6358
</div>

0 commit comments

Comments
 (0)