FIX: suggested username should not be more than setting max_username_length

This commit is contained in:
Arpit Jalan 2017-03-29 18:19:28 +05:30
parent 7cf0f39066
commit bb0fa5abbc
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ module UserNameSuggester
i += 1
end
until attempt == allow_username || User.username_available?(attempt) || i > 200
attempt = SecureRandom.hex[0..SiteSetting.max_username_length]
attempt = SecureRandom.hex[1..SiteSetting.max_username_length]
i += 1
end
attempt