|
|
@@ -1,20 +1,25 @@
|
|
|
{% load form_helpers %}
|
|
|
+{% load helpers %}
|
|
|
|
|
|
{% if form.errors or form.non_field_errors %}
|
|
|
<div class="alert alert-danger mt-3" role="alert">
|
|
|
<h4 class="alert-heading">Errors</h4>
|
|
|
+ {% if form.errors %}
|
|
|
<hr />
|
|
|
+ {% endif %}
|
|
|
<div class="ps-2">
|
|
|
{% if form.errors %}
|
|
|
{% for field_name, errors in form.errors.items %}
|
|
|
- {% with field=form|getfield:field_name %}
|
|
|
- <strong>{{ field.label }}</strong>
|
|
|
- <ul>
|
|
|
- {% for error in errors %}
|
|
|
- <li>{{ error }}</li>
|
|
|
- {% endfor %}
|
|
|
- </ul>
|
|
|
- {% endwith %}
|
|
|
+ {% if not field_name|startswith:'__' %}
|
|
|
+ {% with field=form|getfield:field_name %}
|
|
|
+ <strong>{{ field.label }}</strong>
|
|
|
+ <ul>
|
|
|
+ {% for error in errors %}
|
|
|
+ <li>{{ error }}</li>
|
|
|
+ {% endfor %}
|
|
|
+ </ul>
|
|
|
+ {% endwith %}
|
|
|
+ {% endif %}
|
|
|
{% endfor %}
|
|
|
{% endif %}
|
|
|
{% if form.non_field_errors %}
|