FIX: use correct validation method name for `default_categories_normal`. (#20801)
When we renamed the `default_categories_regular` to `default_categories_normal` we missed a site setting validation method. It allowed the duplicate category ids in `default_categories_normal` site setting and caused the problem in user registration process.
5176c689e9
This commit is contained in:
parent
7c6a8f1c74
commit
ed6f7b1e6d
|
@ -96,7 +96,7 @@ module SiteSettings::Validations
|
||||||
validate_default_categories(category_ids, default_categories_selected)
|
validate_default_categories(category_ids, default_categories_selected)
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_default_categories_regular(new_val)
|
def validate_default_categories_normal(new_val)
|
||||||
category_ids = validate_category_ids(new_val)
|
category_ids = validate_category_ids(new_val)
|
||||||
|
|
||||||
default_categories_selected = [
|
default_categories_selected = [
|
||||||
|
|
|
@ -28,6 +28,10 @@ RSpec.describe SiteSettings::Validations do
|
||||||
expect { SiteSetting.default_categories_tracking = "#{category.id}" }.to raise_error(
|
expect { SiteSetting.default_categories_tracking = "#{category.id}" }.to raise_error(
|
||||||
Discourse::InvalidParameters,
|
Discourse::InvalidParameters,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
expect { SiteSetting.default_categories_normal = "#{category.id}" }.to raise_error(
|
||||||
|
Discourse::InvalidParameters,
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue