Add form errors
This commit is contained in:
parent
0e2fd6e74f
commit
a7e3f92469
2 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
{% if form.non_field_errors %}
|
||||
<ul class='errorlist'>
|
||||
{% for error in form.non_field_errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% for field in form %}
|
||||
{{ field.errors }}
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
|
|
|
@ -13,6 +13,13 @@
|
|||
|
||||
<form action="{% url 'login' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{% if form.non_field_errors %}
|
||||
<ul class='errorlist'>
|
||||
{% for error in form.non_field_errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% for field in form %}
|
||||
{{ field.errors }}
|
||||
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
|
|
Loading…
Reference in a new issue