Commit fbdb4635 authored by Jasper Maes's avatar Jasper Maes

Fix deprecation: redirect_to :back is deprecated

parent bf38936f
...@@ -77,7 +77,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -77,7 +77,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
def reset_health_check_token def reset_health_check_token
@application_setting.reset_health_check_access_token! @application_setting.reset_health_check_access_token!
flash[:notice] = 'New health check access token has been generated!' flash[:notice] = 'New health check access token has been generated!'
redirect_to :back redirect_back_or_default
end end
def clear_repository_check_states def clear_repository_check_states
......
...@@ -76,7 +76,7 @@ class ApplicationController < ActionController::Base ...@@ -76,7 +76,7 @@ class ApplicationController < ActionController::Base
end end
def redirect_back_or_default(default: root_path, options: {}) def redirect_back_or_default(default: root_path, options: {})
redirect_to request.referer.present? ? :back : default, options redirect_back(fallback_location: default, **options)
end end
def not_found def not_found
......
...@@ -15,7 +15,7 @@ module Sherlock ...@@ -15,7 +15,7 @@ module Sherlock
def destroy_all def destroy_all
Gitlab::Sherlock.collection.clear Gitlab::Sherlock.collection.clear
redirect_to :back, status: :found redirect_back_or_default(options: { status: :found })
end end
end end
end end
---
title: 'Fix deprecation: redirect_to :back is deprecated'
merge_request: 23943
author: Jasper Maes
type: other
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment