Skip to content

Commit 097720d

Browse files
authored
Merge pull request #519 from jameslao/length_is_deprecation
`length_is` removed in Django 5.1
2 parents e586f7b + 15b4ed0 commit 097720d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

jazzmin/templates/admin/includes/fieldset.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
{% endif %}
2020

2121
{% for line in fieldset %}
22-
<div class="form-group{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
22+
<div class="form-group{% if line.fields|length == 1 and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
2323
<div class="row">
2424
{% for field in line %}
25-
<label class="{% if not line.fields|length_is:'1' and forloop.counter != 1 %}col-auto {% else %}col-sm-3 {% endif %}text-left" for="id_{{ field.field.name }}">
25+
<label class="{% if not line.fields|length == 1 and forloop.counter != 1 %}col-auto {% else %}col-sm-3 {% endif %}text-left" for="id_{{ field.field.name }}">
2626
{{ field.field.label|capfirst }}
2727
{% if field.field.field.required %}
2828
<span class="text-red">* </span>
2929
{% endif %}
3030
</label>
31-
<div class="{% if not line.fields|length_is:'1' %} col-auto fieldBox {% else %} col-sm-7 {% endif %}
31+
<div class="{% if not line.fields|length == 1 %} col-auto fieldBox {% else %} col-sm-7 {% endif %}
3232
{% if field.field.name %} field-{{ field.field.name }}{% endif %}
3333
{% if not field.is_readonly and field.errors %} errors{% endif %}
3434
{% if field.field.is_hidden %} hidden {% endif %}
@@ -39,13 +39,13 @@
3939
{{ field.field }}
4040
{% endif %}
4141
<div class="help-block red">
42-
{% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
42+
{% if not line.fields|length == 1 and not field.is_readonly %}{{ field.errors }}{% endif %}
4343
</div>
4444
{% if field.field.help_text %}
4545
<div class="help-block">{{ field.field.help_text|safe }}</div>
4646
{% endif %}
4747
<div class="help-block text-red">
48-
{% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
48+
{% if line.fields|length == 1 %}{{ line.errors }}{% endif %}
4949
</div>
5050
</div>
5151
{% endfor %}

0 commit comments

Comments
 (0)