mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
allow for custom min_username_length
change constant in user to be global range and not default
This commit is contained in:
@ -93,9 +93,15 @@ class User < ActiveRecord::Base
|
||||
ALWAYS = -1
|
||||
LAST_VISIT = -2
|
||||
end
|
||||
|
||||
GLOBAL_USERNAME_LENGTH_RANGE = 3..15
|
||||
|
||||
def self.username_length
|
||||
3..15
|
||||
if SiteSetting.enforce_global_nicknames
|
||||
GLOBAL_USERNAME_LENGTH_RANGE
|
||||
else
|
||||
SiteSetting.min_username_length.to_i..GLOBAL_USERNAME_LENGTH_RANGE.end
|
||||
end
|
||||
end
|
||||
|
||||
def custom_groups
|
||||
|
Reference in New Issue
Block a user