An improved handling of the 'no active roles' message.

- Legacy-Id: 14207
This commit is contained in:
Henrik Levkowetz 2017-10-13 12:05:44 +00:00
parent dfaf5a56ac
commit d7618ce26b
2 changed files with 5 additions and 10 deletions

View file

@ -8,5 +8,5 @@ def has_sessions(group,num):
@register.filter
def active_roles(queryset):
return queryset.filter(state_id='active').exclude(group__acronym='secretariat')
return queryset.filter(group__state_id__in=['active', 'bof']).exclude(group__acronym='secretariat')

View file

@ -4,6 +4,7 @@
{% load markup_tags %}
{% load staticfiles %}
{% load ietf_filters %}
{% load group_filters %}
{% block title %}Profile for {{ persons.0 }}{% endblock %}
@ -37,10 +38,7 @@
{% if person.role_set.exists %}
<h2 id="roles">Roles</h2>
<table class="table">
{% if person.role_set.count %}
{% for role in person.role_set.all %}
{% if role.group.state_id == 'active' or role.group.state_id == 'bof' %}
{% if role.group.acronym != 'secretariat' %}
{% for role in person.role_set.all|active_roles %}
<tr>
<td>
{{ role.name.name }}
@ -52,12 +50,9 @@
<a href="mailto:{{role.email.address}}">{{ role.email.address }}</a>
</td>
</tr>
{% endif %}
{% endif %}
{% empty %}
{{ person.first_name }} has no active roles as of {{ today }}.
{% endfor %}
{% else %}
{{ person.first_name }} has no active roles as of {{ today }}.
{% endif %}
</table>
{% endif %}
</div>