From b775ef242f6c6c92aa95227c311129e39fe01c6c Mon Sep 17 00:00:00 2001 From: JimiRecard <58371938+JimiRecard@users.noreply.github.com> Date: Mon, 6 Jun 2022 15:53:16 -0300 Subject: [PATCH] Fix table formset checkbox (#107) * Remove empty divs for checkboxes when rendering table_inline_formsets * Fix tests accordingly --- crispy_bootstrap5/templates/bootstrap5/field.html | 4 ++-- tests/results/test_tabular_formset_layout.html | 8 -------- .../test_tabular_formset_layout_failing.html | 14 +++++--------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/crispy_bootstrap5/templates/bootstrap5/field.html b/crispy_bootstrap5/templates/bootstrap5/field.html index 142df08..538b8d5 100644 --- a/crispy_bootstrap5/templates/bootstrap5/field.html +++ b/crispy_bootstrap5/templates/bootstrap5/field.html @@ -3,7 +3,7 @@ {% if field.is_hidden %} {{ field }} {% else %} - {% if field|is_checkbox %} + {% if field|is_checkbox and tag != "td" %}