Amit Upadhyay wrote:
...
> {% if form.has_errors %}
> <center><font color="red">Email or password incorrect</font></center>
> {% endif %}
...

BTW I tried that, but ran into a small problem... hard-coding the error
message in the template like that masks the fact that "please enter a
correct username and password" isn't the only error that
AuthenticationForm can return. It also checks that cookies are working,
and because my template produced the "standard" error message I had a
confused user on my hands who used the right username and password but
had a cookie problem.

So, instead of checking form.has_errors, I changed my template to
present form.username.errors and form.password.errors. (Like the
create_form in
http://www.djangoproject.com/documentation/forms/#using-the-addmanipulator)
That seems to do better at disclosing the true nature of the error.

Reply via email to