diff options
author | Rémy Coutable <remy@rymai.me> | 2018-06-13 10:42:40 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-06-13 10:42:40 +0000 |
commit | f23dbfd6c6f4d72403bef8a251be014abd80ca69 (patch) | |
tree | 775bec75d05cb91804cd0c686a8a81d94af5955f | |
parent | 115ab79b702ea19aec45c884e3b0caa95ca02e88 (diff) | |
parent | 5e2b8ab8d7d80f91a6d1e1951041defcd431b841 (diff) | |
download | gitlab-ce-f23dbfd6c6f4d72403bef8a251be014abd80ca69.tar.gz |
Merge branch '45575-invalid-characters-signup' into 'master'
Resolve "Bug: When creating an account with invalid characters the error is "Username already taken" not "Invalid characters used""
Closes #45575
See merge request gitlab-org/gitlab-ce!19610
-rw-r--r-- | app/assets/javascripts/pages/sessions/new/username_validator.js | 9 | ||||
-rw-r--r-- | changelogs/unreleased/45575-invalid-characters-signup.yml | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/app/assets/javascripts/pages/sessions/new/username_validator.js b/app/assets/javascripts/pages/sessions/new/username_validator.js index 825de01b5a2..87213c94eda 100644 --- a/app/assets/javascripts/pages/sessions/new/username_validator.js +++ b/app/assets/javascripts/pages/sessions/new/username_validator.js @@ -62,13 +62,13 @@ export default class UsernameValidator { return this.setPendingState(); } - if (!this.state.available) { - return this.setUnavailableState(); - } - if (!this.state.valid) { return this.setInvalidState(); } + + if (!this.state.available) { + return this.setUnavailableState(); + } } interceptInvalid(event) { @@ -89,7 +89,6 @@ export default class UsernameValidator { setAvailabilityState(usernameTaken) { if (usernameTaken) { - this.state.valid = false; this.state.available = false; } else { this.state.available = true; diff --git a/changelogs/unreleased/45575-invalid-characters-signup.yml b/changelogs/unreleased/45575-invalid-characters-signup.yml new file mode 100644 index 00000000000..679bd13e59b --- /dev/null +++ b/changelogs/unreleased/45575-invalid-characters-signup.yml @@ -0,0 +1,5 @@ +--- +title: 'Fix username validation order on signup, resolves #45575' +merge_request: 19610 +author: Jan Beckmann +type: fixed |