X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/48ed305163ac44e420de60d7ffc5af1a1c3950c2..3d79f9fd88ab2784b292c8eafc46070472b2a4c9:/app/controllers/preferences_controller.rb?ds=inline diff --git a/app/controllers/preferences_controller.rb b/app/controllers/preferences_controller.rb index dcf0d8b64..f002d5d39 100644 --- a/app/controllers/preferences_controller.rb +++ b/app/controllers/preferences_controller.rb @@ -21,7 +21,15 @@ class PreferencesController < ApplicationController else params[:user][:preferred_editor] end - if current_user.save + + success = current_user.save + + if params[:site_color_scheme] + site_color_scheme_preference = current_user.preferences.find_or_create_by(:k => "site.color_scheme") + success &= site_color_scheme_preference.update(:v => params[:site_color_scheme]) + end + + if success # Use a partial so that it is rendered during the next page load in the correct language. flash[:notice] = { :partial => "preferences/update_success_flash" } redirect_to preferences_path