from flask import url_for


def register_template_utils(app):
    """Register Jinja 2 helpers (called from __init__.py)."""

    @app.template_test()
    def equalto(value, other):
        return value == other

    @app.template_global()
    def is_hidden_field(field):
        from wtforms.fields import HiddenField
        return isinstance(field, HiddenField)

    app.add_template_global(index_for_role)


def index_for_role(role):
    return url_for(role.name + '.index')

from flask import url_for


def register_template_utils(app):
    """Register Jinja 2 helpers (called from __init__.py)."""

    @app.template_test()
    def equalto(value, other):
        return value == other

    @app.template_global()
    def is_hidden_field(field):
        from wtforms.fields import HiddenField
        return isinstance(field, HiddenField)

    app.add_template_global(index_for_role)


def index_for_role(role):
    return url_for(role.index)

Fix index_for_role function to use index field in Role class.
Fix index_for_role function to use index field in Role class.

  from flask import url_for
  
  
  def register_template_utils(app):
      """Register Jinja 2 helpers (called from __init__.py)."""
  
      @app.template_test()
      def equalto(value, other):
          return value == other
  
      @app.template_global()
      def is_hidden_field(field):
          from wtforms.fields import HiddenField
          return isinstance(field, HiddenField)
  
      app.add_template_global(index_for_role)
  
  
  def index_for_role(role):
-     return url_for(role.name + '.index')
+     return url_for(role.index)
  
Fix index_for_role function to use index field in Role class.
## Code Before:
from flask import url_for


def register_template_utils(app):
    """Register Jinja 2 helpers (called from __init__.py)."""

    @app.template_test()
    def equalto(value, other):
        return value == other

    @app.template_global()
    def is_hidden_field(field):
        from wtforms.fields import HiddenField
        return isinstance(field, HiddenField)

    app.add_template_global(index_for_role)


def index_for_role(role):
    return url_for(role.name + '.index')

## Instruction:
Fix index_for_role function to use index field in Role class.
## Code After:
from flask import url_for


def register_template_utils(app):
    """Register Jinja 2 helpers (called from __init__.py)."""

    @app.template_test()
    def equalto(value, other):
        return value == other

    @app.template_global()
    def is_hidden_field(field):
        from wtforms.fields import HiddenField
        return isinstance(field, HiddenField)

    app.add_template_global(index_for_role)


def index_for_role(role):
    return url_for(role.index)
