Skip to content

Commit 12f41c3

Browse files
authored
fix: django length_is migration (#442)
1 parent ce583b4 commit 12f41c3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/unfold/templates/admin/edit_inline/tabular.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
1616
{{ inline_admin_formset.formset.non_form_errors }}
1717

1818
<div>
19-
{% if not inline_admin_formset.has_add_permission and inline_admin_formset.forms|length_is:0 %}
19+
{% if not inline_admin_formset.has_add_permission and inline_admin_formset.forms|length == 0 %}
2020
<p class="mb-6 text-gray-500 text-sm dark:text-gray-400">
2121
{% trans "No records found." %}
2222
</p>

src/unfold/templates/admin/includes/fieldset.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
1515

1616
<div class="aligned mb-8 {% if not stacked %}border border-gray-200 rounded-md pt-3 px-3 shadow-sm dark:border-gray-800{% endif %}">
1717
{% for line in fieldset %}
18-
<div class="form-row block {% if not line.fields|length_is:'1' %}flex flex-row flex-wrap gap-x-8{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
18+
<div class="form-row block {% if not line.fields|length == 1 %}flex flex-row flex-wrap gap-x-8{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
1919
{% for field in line %}
20-
<div class="flex group {% if field.errors %}errors {% endif %}{% if not line.fields|length_is:1 %}lg:max-w-xs w-full {% endif %}{% if not forloop.parentloop.last %} mb-6 {% else %} mb-3{% endif %} {% if row %}flex-row items-center{% else %}flex-col{% endif %}">
20+
<div class="flex group {% if field.errors %}errors {% endif %}{% if not line.fields|length == 1 %}lg:max-w-xs w-full {% endif %}{% if not forloop.parentloop.last %} mb-6 {% else %} mb-3{% endif %} {% if row %}flex-row items-center{% else %}flex-col{% endif %}">
2121
{% if field.is_checkbox %}
2222
<div class="flex flex-row items-center">
2323
{{ field.field }}{{ field.label_tag }}

0 commit comments

Comments
 (0)