2
0
Fork 0
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:
Krzysztof Kotlarek 2025-07-16 14:30:08 +08:00 committed by GitHub
parent 679d51a985
commit 2ee1c6d7d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

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

View file

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