Modal forms now display non-field errors

- Critical for errors not relating to a particular field (e.g. unique_together)
- Ref: https://stackoverflow.com/questions/7419535/how-to-render-django-form-errors-not-in-a-ul
This commit is contained in:
Oliver Walters 2019-04-26 23:00:48 +10:00
parent 73282801c9
commit 1c710e71a5

View File

@ -1,5 +1,14 @@
{% if form.non_field_errors %}
<div class='alert alert-danger' role='alert' style='display: block;'>
<b>Error Submitting Form:</b>
{{ form.non_field_errors }}
</div>
{% endif %}
<form method="post" action='' class='js-modal-form' enctype="multipart/form-data">
{% csrf_token %}
{% load crispy_forms_tags %}
{% crispy form %}
</form>