mirror of
https://github.com/discourse/discourse.git
synced 2025-10-04 17:32:34 +08:00
FIX: enforce system themes to be enabled (#33643)
Ensure that the system themes are always enabled.
This commit is contained in:
parent
679d51a985
commit
2ee1c6d7d4
2 changed files with 8 additions and 0 deletions
|
@ -26,6 +26,7 @@ class SystemThemesManager
|
|||
.first
|
||||
&.update!(user_selectable: true)
|
||||
end
|
||||
remote_theme.update_column(:enabled, true)
|
||||
Stylesheet::Manager.clear_theme_cache!
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,4 +12,11 @@ RSpec.describe SystemThemesManager do
|
|||
expect(Theme.horizon_theme.color_schemes.where(user_selectable: true).count).to eq(2)
|
||||
expect(Theme.horizon_theme.color_schemes.where(user_selectable: false).count).to eq(10)
|
||||
end
|
||||
|
||||
it "renables themes" do
|
||||
SystemThemesManager.sync!
|
||||
Theme.horizon_theme.update_column(:enabled, false)
|
||||
SystemThemesManager.sync!
|
||||
expect(Theme.horizon_theme.reload.enabled).to be true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue