Merge pull request #2545 from techAPJ/patch-1

FIX: Instead of silently failing, assign alternative username when provi...
This commit is contained in:
Robin Ward 2014-07-15 16:00:06 -04:00
commit 6406102815
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ InviteRedeemer = Struct.new(:invite, :username, :name) do
user_exists = User.find_by_email(invite.email)
return user if user_exists
if username && User.username_available?(username)
if username && UsernameValidator.new(username).valid_format? && User.username_available?(username)
available_username = username
else
available_username = UserNameSuggester.suggest(invite.email)