From d56efb8f8290f2e88e5a584b8ae6806023035003 Mon Sep 17 00:00:00 2001 From: Cezar Pendarovski Date: Thu, 4 Sep 2014 15:26:00 +0200 Subject: [PATCH] Display validation errors on login form --- .../templates/rest_framework/login_base.html | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/rest_framework/templates/rest_framework/login_base.html b/rest_framework/templates/rest_framework/login_base.html index 43860e53e..75e6d4727 100644 --- a/rest_framework/templates/rest_framework/login_base.html +++ b/rest_framework/templates/rest_framework/login_base.html @@ -18,17 +18,32 @@
+ {% if form.non_field_errors %} + {% for error in form.non_field_errors %} +

{{ error }}

+ {% endfor %} + {% endif %} {% csrf_token %}
+ {% if form.username.errors %} +

+ {{ form.username.errors|striptags }} +

+ {% endif %} - +
-
+
+ {% if form.password.errors %} +

+ {{ form.password.errors|striptags }} +

+ {% endif %} - +