mirror of
https://github.com/discourse/discourse.git
synced 2025-04-01 11:45:42 +08:00
FIX: suggested username should not be more than setting max_username_length
This commit is contained in:
parent
7cf0f39066
commit
bb0fa5abbc
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user