From 4266c4578b9fb01fda3dfb3e3d2744290e43fa0f Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 22 Oct 2011 15:31:12 +0000 Subject: [PATCH] fix a bug with resetting passwords --- pandora/user/views.py | 4 ++-- static/js/pandora/autovalidate.js | 2 +- static/js/pandora/ui/account.js | 11 +++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pandora/user/views.py b/pandora/user/views.py index bb4f0481..066cdbf3 100644 --- a/pandora/user/views.py +++ b/pandora/user/views.py @@ -192,7 +192,7 @@ def resetPassword(request): status: {'code': int, 'text': string} data: { errors: { - code: 'Invalid Code' + code: 'Incorrect Code' } user { } @@ -226,7 +226,7 @@ def resetPassword(request): else: response = json_response({ 'errors': { - 'code': 'Invalid code' + 'code': 'Incorrect code' } }) diff --git a/static/js/pandora/autovalidate.js b/static/js/pandora/autovalidate.js index 3d0dd3f0..60be666b 100644 --- a/static/js/pandora/autovalidate.js +++ b/static/js/pandora/autovalidate.js @@ -1,7 +1,7 @@ // vim: et:ts=4:sw=4:sts=4:ft=javascript pandora.autovalidateCode = function(value, blur, callback) { - value = value.split('').map(function(v) { + value = value.toUpperCase().split('').map(function(v) { return /[A-Z]/.test(v) ? v : null; }).join('').substr(0, 16); callback({valid: value.length == 16, value: value}); diff --git a/static/js/pandora/ui/account.js b/static/js/pandora/ui/account.js index bd7b4d0e..c10fcb10 100644 --- a/static/js/pandora/ui/account.js +++ b/static/js/pandora/ui/account.js @@ -31,7 +31,7 @@ pandora.ui.accountDialogOptions = function(action, value) { signin: 'Sign In', signup: 'Sign Up', reset: 'Reset Password', - resetAndSignin: 'Reset Password and Sign In' + resetAndSignin: 'Sign In' }, dialogText = { signin: 'To sign in to your account, please enter your username and password.', @@ -67,16 +67,19 @@ pandora.ui.accountDialogOptions = function(action, value) { id: type, title: buttonTitle[type] + '...' }).bindEvent('click', function() { - //Ox.print('CLICK EVENT', type) pandora.$ui.accountDialog.options(pandora.ui.accountDialogOptions(type)); }); } } return { - buttons: Ox.merge(buttons[action].map(function(type) { + buttons: Ox.merge( + buttons[action].map(function(type) { return button(type); - }), [{}, button('cancel'), button('submit')]), + }), + buttons[action].length ? [{}] : [], + [button('cancel'), button('submit')] + ), content: Ox.Element() .append( $('')