From e7bd1533c4f74d35cf08b5a1937db39b2bf9faf7 Mon Sep 17 00:00:00 2001 From: Matt Wright Date: Wed, 11 Jul 2012 16:38:26 -0400 Subject: [PATCH] Move it --- flask_security/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flask_security/views.py b/flask_security/views.py index 2e35236..e6852d0 100644 --- a/flask_security/views.py +++ b/flask_security/views.py @@ -116,11 +116,12 @@ def authenticate(): except BadCredentialsError, e: msg = str(e) + _logger.debug('Unsuccessful authentication attempt: %s' % msg) + if request.json: return _json_auth_error(msg) do_flash(msg, 'error') - _logger.debug('Unsuccessful authentication attempt: %s' % msg) return redirect(request.referrer or _security.login_manager.login_view)