Authentication: show errors for username / password login failures

This commit is contained in:
Stephan Bösch-Plepelits 2016-01-14 21:21:08 +01:00
parent 7477adec05
commit 8f5b59604e

View file

@ -4,6 +4,14 @@
<h5>{% trans "Please log in with your account" %}</h5> <h5>{% trans "Please log in with your account" %}</h5>
<div> <div>
{% if form.non_field_errors %}
<ul class='form-errors'>
{% for error in form.non_field_errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
<form id='login_form' action="{% url 'login' %}" method="POST"> <form id='login_form' action="{% url 'login' %}" method="POST">
{% csrf_token %} {% csrf_token %}
<input type="text" name="username" placeholder="{% trans 'Username' %}" autofocus /> <input type="text" name="username" placeholder="{% trans 'Username' %}" autofocus />