2021-03-14 01:06:51 -07:00
|
|
|
{% load form_helpers %}
|
2021-03-15 08:53:48 -07:00
|
|
|
{% load helpers %}
|
2021-03-14 01:06:51 -07:00
|
|
|
|
|
|
|
{% if form.errors or form.non_field_errors %}
|
|
|
|
<div class="alert alert-danger mt-3" role="alert">
|
|
|
|
<h4 class="alert-heading">Errors</h4>
|
2021-03-15 08:53:48 -07:00
|
|
|
{% if form.errors %}
|
2021-03-14 01:06:51 -07:00
|
|
|
<hr />
|
2021-03-15 08:53:48 -07:00
|
|
|
{% endif %}
|
2021-03-14 01:06:51 -07:00
|
|
|
<div class="ps-2">
|
|
|
|
{% if form.errors %}
|
|
|
|
{% for field_name, errors in form.errors.items %}
|
2021-03-15 08:53:48 -07:00
|
|
|
{% 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 %}
|
2021-03-14 01:06:51 -07:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% if form.non_field_errors %}
|
|
|
|
<hr />
|
|
|
|
{{ form.non_field_errors }}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|