From f82f2d8b07102bca4554b12c03a9770e305c677e Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 16 Nov 2013 14:16:20 +0000 Subject: [PATCH] allow signups while using alternative auth backend(2) --- static/js/account.js | 5 +++++ static/js/autovalidate.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/static/js/account.js b/static/js/account.js index b6e0f541..cf87afcc 100644 --- a/static/js/account.js +++ b/static/js/account.js @@ -166,6 +166,11 @@ pandora.ui.accountForm = function(action, value) { pandora.signin(result.data); pandora.ui.accountWelcomeDialog().open(); } else { + Ox.forEach(result.data.errors, function(value, key) { + if (['username', 'password', 'email'].indexOf(key) > -1) { + that.setMessages([{id: key, message: Ox._(result.data.errors[key])}]); + } + }); pandora.$ui.accountDialog.enableButtons(); } }); diff --git a/static/js/autovalidate.js b/static/js/autovalidate.js index 3d9ac19a..c20b012d 100644 --- a/static/js/autovalidate.js +++ b/static/js/autovalidate.js @@ -97,7 +97,7 @@ pandora.validateUser = function(key, existing) { value: value, operator: '==' }, function(result) { - var valid = existing == !!result.data.users.length; + var valid = (existing == !!result.data.users.length) || pandora.site.site.dontValidateUser; callback({ message: existing ? Ox._('Unknown ' + string) :