From ba959152b6ba8e436d556951b7efc4a8f1e55dd6 Mon Sep 17 00:00:00 2001 From: Matthew Mongeau Date: Tue, 17 Jul 2012 13:09:14 -0400 Subject: [PATCH] Login errors should display on first failure. --- lms/templates/login_modal.html | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lms/templates/login_modal.html b/lms/templates/login_modal.html index f8c1ca0caf..b13e3a2a0e 100644 --- a/lms/templates/login_modal.html +++ b/lms/templates/login_modal.html @@ -59,15 +59,16 @@ postJSON('/login', submit_data, function(json) { - if(json.success) { - location.href="${reverse('dashboard')}"; - } else if($('#login_error').length == 0) { - $('#login_form').prepend('
Email or password is incorrect.
'); - } else { - $('#login_error').stop().css("display", "block"); - } - } - ); - }); + if(json.success) { + location.href="${reverse('dashboard')}"; + } else { + if($('#login_error').length == 0) { + $('#login_form').prepend('
Email or password is incorrect.
'); + } + $('#login_error').stop().css("display", "block"); + } + } + ); + }); })(this)