FIX: allow selecting site's default theme from preference

This commit is contained in:
Osama Sayegh
2018-08-10 14:12:02 +03:00
committed by GitHub
parent 2b2612d0f5
commit 865cb3feb9
3 changed files with 26 additions and 0 deletions

View File

@@ -88,6 +88,7 @@ class UserUpdater
# special handling for theme_id cause we need to bump a sequence number
if attributes.key?(:theme_ids)
user_guardian = Guardian.new(user)
attributes[:theme_ids].reject!(&:blank?)
attributes[:theme_ids].map!(&:to_i)
if user_guardian.allow_themes?(attributes[:theme_ids])
user.user_option.theme_key_seq += 1 if user.user_option.theme_ids != attributes[:theme_ids]