summaryrefslogtreecommitdiff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authorMartin Wortschack <mwortschack@gitlab.com>2018-09-06 15:44:15 +0200
committerMartin Wortschack <mwortschack@gitlab.com>2018-09-06 15:44:15 +0200
commit276e78e05885fe39e8ad72a41a01587f1e28cfd5 (patch)
tree7d8a28a46719c7451991a424bbe083ff409ed064 /app/controllers/admin
parent3b8994d1ee9642555e18a8a05c530aec50df087f (diff)
downloadgitlab-ce-276e78e05885fe39e8ad72a41a01587f1e28cfd5.tar.gz
handle redirect properly
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/application_settings_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb
index 7d7221c2726..f9451decc19 100644
--- a/app/controllers/admin/application_settings_controller.rb
+++ b/app/controllers/admin/application_settings_controller.rb
@@ -9,8 +9,10 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
.new(@application_setting, current_user, application_setting_params)
.execute
+ redirect_path = params[:redirect_path] ? params[:redirect_path].to_h : admin_application_settings_path
+
if successful
- redirect_to request.referer,
+ redirect_to redirect_path,
notice: 'Application settings saved successfully'
else
render :show