{% comment %} Crispy field template for the TenantRoleForm permissions field. crispy_bootstrap5 detects ``CheckboxSelectMultiple`` and renders via ``radio_checkbox_select.html`` (a flat optgroups iteration) — bypassing the widget's own ``template_name``. To bring back the grouped + filterable layout from ``_permission_widget.html``, this template just calls ``{{ field }}``, which triggers Django's widget renderer and lands on ``GroupedPermissionWidget.get_context`` / ``_permission_widget.html``. {% endcomment %} {% load i18n crispy_forms_filters %}
{% if field.label %} {% endif %} {{ field }} {% include 'bootstrap5/layout/help_text_and_errors.html' %}