diff --git a/src/authentic2/manager/role_views.py b/src/authentic2/manager/role_views.py index bf65fc494..5595d60bd 100644 --- a/src/authentic2/manager/role_views.py +++ b/src/authentic2/manager/role_views.py @@ -144,6 +144,11 @@ export = RolesExportView.as_view() class RoleViewMixin(RolesMixin): model = get_role_model() + def get_context_data(self, **kwargs): + ctx = super().get_context_data(**kwargs) + ctx['ou'] = self.get_object().ou + return ctx + class RoleEditView(RoleViewMixin, views.BaseEditView): template_name = 'authentic2/manager/role_edit.html' diff --git a/src/authentic2/manager/templates/authentic2/manager/role_common.html b/src/authentic2/manager/templates/authentic2/manager/role_common.html index 3167b9d0c..7fb36c651 100644 --- a/src/authentic2/manager/templates/authentic2/manager/role_common.html +++ b/src/authentic2/manager/templates/authentic2/manager/role_common.html @@ -6,8 +6,7 @@ {% block breadcrumb %} {{ block.super }} {% trans 'Roles' %} - {% firstof ou object.ou as current_ou %} - {% if multiple_ou and current_ou %} - {{ current_ou }} + {% if multiple_ou and ou %} + {{ ou }} {% endif %} {% endblock %}