diff --git a/ietf/doc/templatetags/ietf_filters.py b/ietf/doc/templatetags/ietf_filters.py index 2e7dc8cf6..45b6d0578 100644 --- a/ietf/doc/templatetags/ietf_filters.py +++ b/ietf/doc/templatetags/ietf_filters.py @@ -414,14 +414,6 @@ def equal(x, y): def startswith(x, y): return unicode(x).startswith(y) -# based on http://www.djangosnippets.org/snippets/847/ by 'whiteinge' -@register.filter -def in_group(user, groups): - if settings.USE_DB_REDESIGN_PROXY_CLASSES: - return has_role(user, groups.replace("Area_Director", "Area Director")) - - return user and user.is_authenticated() and bool(user.groups.filter(name__in=groups.split(',')).values('name')) - @register.filter def has_role(user, role_names): from ietf.ietfauth.decorators import has_role diff --git a/ietf/templates/base/left_menu.html b/ietf/templates/base/left_menu.html index 9b44d11ad..6bc13926b 100644 --- a/ietf/templates/base/left_menu.html +++ b/ietf/templates/base/left_menu.html @@ -89,7 +89,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ISE
  • Submit a draft
  • -{% if user|in_group:"WG Chair" %} +{% if user|has_role:"WG Chair" %}
  • Approve a draft
  • {% endif %} {% get_user_managed_lists user as community_lists %} @@ -101,7 +101,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. {% else %}
  • Sign in to track drafts
  • {% endif %} -{% if user|in_group:"Area_Director,Secretariat" %} +{% if user|has_role:"Area_Director,Secretariat" %}
  • RFC status changes
  • {% endif %} diff --git a/ietf/templates/doc/ballot/approvaltext.html b/ietf/templates/doc/ballot/approvaltext.html index f58ae42a6..80b8271f7 100644 --- a/ietf/templates/doc/ballot/approvaltext.html +++ b/ietf/templates/doc/ballot/approvaltext.html @@ -26,7 +26,7 @@ form #id_approval_text { {% load ietf_filters %} -{% if user|in_group:"Secretariat" %} +{% if user|has_role:"Secretariat" %}

    {% if can_announce %} Approve ballot diff --git a/ietf/templates/doc/ballot/lastcalltext.html b/ietf/templates/doc/ballot/lastcalltext.html index 135af9b64..574155daf 100644 --- a/ietf/templates/doc/ballot/lastcalltext.html +++ b/ietf/templates/doc/ballot/lastcalltext.html @@ -35,7 +35,7 @@ form #id_last_call_text { {% load ietf_filters %} -{% if user|in_group:"Secretariat" %} +{% if user|has_role:"Secretariat" %}

    {% if can_make_last_call %} Make Last Call diff --git a/ietf/templates/doc/draft/edit_info.html b/ietf/templates/doc/draft/edit_info.html index 6ff175f9b..68851832a 100644 --- a/ietf/templates/doc/draft/edit_info.html +++ b/ietf/templates/doc/draft/edit_info.html @@ -44,7 +44,7 @@ form.edit-info .actions { {{ form.returning_item }} {{ form.returning_item.label_tag }} {{ form.returning_item.errors }} {% endifequal %} {% ifequal field.name "ad" %} - {% if user|in_group:"Area_Director" %} + {% if user|has_role:"Area Director" %} {% endif %} {% endifequal %} diff --git a/ietf/templates/doc/status_change/last_call.html b/ietf/templates/doc/status_change/last_call.html index 6da9ec714..58e156c73 100644 --- a/ietf/templates/doc/status_change/last_call.html +++ b/ietf/templates/doc/status_change/last_call.html @@ -33,7 +33,7 @@ form #id_last_call_text { {% load ietf_filters %} -{% if user|in_group:"Secretariat" %} +{% if user|has_role:"Secretariat" %}

    Make Last Call

    diff --git a/ietf/templates/doc/status_change/status_changes.html b/ietf/templates/doc/status_change/status_changes.html index 5b84dd4ab..02536d1f3 100644 --- a/ietf/templates/doc/status_change/status_changes.html +++ b/ietf/templates/doc/status_change/status_changes.html @@ -4,7 +4,7 @@ {% block content %}

    RFC Status Changes

    -{% if user|in_group:"Area_Director,Secretariat" %} +{% if user|has_role:"Area Director,Secretariat" %}

    Start new RFC status change document

    {% endif %} {% regroup docs by get_state as state_groups %}