mirror of
https://github.com/discourse/discourse.git
synced 2025-09-09 12:21:04 +08:00
FEATURE: global admin override of most of the user preferences
This commit is contained in:
parent
73264648f2
commit
bef80633b1
56 changed files with 438 additions and 215 deletions
|
@ -14,4 +14,13 @@ module SiteSettingValidations
|
|||
validate_error :min_username_length_range if new_val < SiteSetting.min_username_length
|
||||
validate_error :max_username_length_exists if User.where('length(username) > ?', new_val).exists?
|
||||
end
|
||||
|
||||
def validate_default_categories(new_val)
|
||||
validate_error :default_categories_already_selected if (new_val.split("|").to_set & SiteSetting.default_categories_selected).size > 0
|
||||
end
|
||||
|
||||
alias_method :validate_default_categories_watching, :validate_default_categories
|
||||
alias_method :validate_default_categories_tracking, :validate_default_categories
|
||||
alias_method :validate_default_categories_muted, :validate_default_categories
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue