mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
FIX: Resetting selectable avatars was failing (#16302)
This commit is contained in:
parent
2b974d4992
commit
b1211bee97
@ -508,6 +508,8 @@ module SiteSettingExtension
|
||||
value = current[name]
|
||||
end
|
||||
|
||||
return [] if value.empty?
|
||||
|
||||
value = value.split("|").map(&:to_i)
|
||||
uploads_list = Upload.where(id: value).to_a
|
||||
uploads[name] = uploads_list if uploads_list
|
||||
|
@ -254,8 +254,11 @@ describe SiteSettingExtension do
|
||||
end
|
||||
|
||||
describe "remove_override" do
|
||||
fab!(:upload) { Fabricate(:upload) }
|
||||
|
||||
before do
|
||||
settings.setting(:test_override, "test")
|
||||
settings.setting(:image_list_test, "", type: :uploaded_image_list)
|
||||
settings.refresh!
|
||||
end
|
||||
it "correctly nukes overrides" do
|
||||
@ -263,6 +266,12 @@ describe SiteSettingExtension do
|
||||
settings.remove_override!(:test_override)
|
||||
expect(settings.test_override).to eq("test")
|
||||
end
|
||||
|
||||
it "correctly nukes overrides for image list type setting" do
|
||||
settings.image_list_test = "#{upload.id}"
|
||||
settings.remove_override!(:image_list_test)
|
||||
expect(settings.image_list_test).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
describe "string setting" do
|
||||
|
Loading…
Reference in New Issue
Block a user