Skip to content

Commit

Permalink
Fix |length_is deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
vdboor committed Feb 5, 2024
1 parent 014af46 commit 0882511
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% for adminfield in line %} {{ adminfield.field.name }}{% if adminfield.field.is_hidden %} cp-has-hidden-field{% endif %}{% endfor %}">
{% if line.fields|length_is:'1' %}{{ line.errors|linebreaksbr }}{% endif %}
<div class="form-row{% if line.fields|length == 1 and line.errors %} errors{% endif %}{% for adminfield in line %} {{ adminfield.field.name }}{% if adminfield.field.is_hidden %} cp-has-hidden-field{% endif %}{% endfor %}">
{% if line.fields|length == 1 %}{{ line.errors|linebreaksbr }}{% endif %}
{% for adminfield in line %}{% if not adminfield.field.is_hidden %}
<div{% if not line.fields|length_is:'1' %} class="field-box{% if not adminfield.is_readonly and adminfield.errors %} errors{% endif %}"{% endif %}>
<div{% if line.fields|length > 1 %} class="field-box{% if not adminfield.is_readonly and adminfield.errors %} errors{% endif %}"{% endif %}>
<div class="flex-container">{# for Django 4+ #}
{% if not line.fields|length_is:'1' and not adminfield.is_readonly %}{{ adminfield.errors }}{% endif %}
{% if line.fields|length > 1 and not adminfield.is_readonly %}{{ adminfield.errors }}{% endif %}
{% if adminfield.is_checkbox %}
{{ adminfield.field }}{{ adminfield.label_tag }}
{% else %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="form-row{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% for adminfield in line %} {{ adminfield.field.name }}{% if adminfield.field.is_hidden %} cp-has-hidden-field{% endif %}{% endfor %}">
{% if line.fields|length_is:'1' %}{{ line.errors|linebreaksbr }}{% endif %}
<div class="form-row{% if line.fields|length == 1 and line.errors %} errors{% endif %}{% for adminfield in line %} {{ adminfield.field.name }}{% if adminfield.field.is_hidden %} cp-has-hidden-field{% endif %}{% endfor %}">
{% if line.fields|length == 1 %}{{ line.errors|linebreaksbr }}{% endif %}
{% for adminfield in line %}{% if not adminfield.field.is_hidden %}
<div{% if not line.fields|length_is:'1' %} class="field-box{% if not adminfield.is_readonly and adminfield.errors %} errors{% endif %}"{% endif %}>
<div{% if line.fields|length > 1 %} class="field-box{% if not adminfield.is_readonly and adminfield.errors %} errors{% endif %}"{% endif %}>
<div class="flex-container">{# for Django 4+ #}
{% if not line.fields|length_is:'1' and not adminfield.is_readonly %}{{ adminfield.errors }}{% endif %}
{% if line.fields|length > 1 and not adminfield.is_readonly %}{{ adminfield.errors }}{% endif %}
{% if adminfield.is_checkbox %}
{{ adminfield.field }}{{ adminfield.label_tag }}
{% else %}
Expand Down

0 comments on commit 0882511

Please sign in to comment.