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:
Vinoth Kannan 2023-03-24 11:40:37 +05:30 committed by GitHub
parent 7c6a8f1c74
commit ed6f7b1e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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 = [

View File

@ -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