Bug: When creating an account with invalid characters the error is "Username already taken" not "Invalid characters used"

Summary

When signing up for a new username, the validation gives a Username is already taken error message when user puts in symbols instead of the correct Please create a username with only alphanumeric characters message.

Steps to reproduce

  1. Go to /users/sign_in
  2. Starting filling out the Register form, in the username field, write a symbol such as @.
  3. Sometimes, when you delete the symbol and reenter it, the proper error message will show.

Example Project

N/A

What is the current bug behavior?

The validation error shows Username is already taken instead of Please create a username with only alphanumeric characters

What is the expected correct behavior?

It should show the correct error message.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Reproducible in GitLab.com

GitLab Enterprise Edition 10.7.0-rc7-ee 60b675d

Possible fixes

NOTE:

I believe _ and - are allowed in usernames - I don't know if that is typically considered alphanumeric, but we may need to change that error message as well if that is not the case.

Edited by Mark Fletcher