From 5da9514f4db9286d497fce95265047a1d04c55f3 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Wed, 28 Dec 2016 09:54:46 -0500 Subject: [PATCH 1/2] =?UTF-8?q?Don=E2=80=99t=20validate=20username=20serve?= =?UTF-8?q?r=20side=20if=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1097 by not making the server-side username validation call if the client side validations have failed. This is not the ideal way to do this, since it’s getting the input from an array. However, to make this different would require significant refactor. --- src/components/registration/steps.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/registration/steps.jsx b/src/components/registration/steps.jsx index ae35ad8a8..34dd2ce71 100644 --- a/src/components/registration/steps.jsx +++ b/src/components/registration/steps.jsx @@ -136,7 +136,9 @@ module.exports = { }.bind(this)); }, onUsernameBlur: function (event) { - this.validateUsername(event.currentTarget.value); + if (this.refs.form.refs.formsy.inputs[0].isValidValue(event.currentTarget.value)) { + this.validateUsername(event.currentTarget.value); + } }, onValidSubmit: function (formData) { this.setState({waiting: true}); @@ -183,6 +185,7 @@ module.exports = { Date: Wed, 28 Dec 2016 10:03:11 -0500 Subject: [PATCH 2/2] remove test ref whoopsie :) --- src/components/registration/steps.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/registration/steps.jsx b/src/components/registration/steps.jsx index 34dd2ce71..a6d8ee961 100644 --- a/src/components/registration/steps.jsx +++ b/src/components/registration/steps.jsx @@ -185,7 +185,6 @@ module.exports = {