Merge pull request #2545 from techAPJ/patch-1
FIX: Instead of silently failing, assign alternative username when provi...
This commit is contained in:
commit
6406102815
|
@ -22,7 +22,7 @@ InviteRedeemer = Struct.new(:invite, :username, :name) do
|
||||||
user_exists = User.find_by_email(invite.email)
|
user_exists = User.find_by_email(invite.email)
|
||||||
return user if user_exists
|
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
|
available_username = username
|
||||||
else
|
else
|
||||||
available_username = UserNameSuggester.suggest(invite.email)
|
available_username = UserNameSuggester.suggest(invite.email)
|
||||||
|
|
Loading…
Reference in New Issue