diff options
Diffstat (limited to 'app/controllers/settings')
-rw-r--r-- | app/controllers/settings/deletes_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/settings/deletes_controller.rb b/app/controllers/settings/deletes_controller.rb index dd18b4c2f..80002b995 100644 --- a/app/controllers/settings/deletes_controller.rb +++ b/app/controllers/settings/deletes_controller.rb @@ -3,6 +3,7 @@ class Settings::DeletesController < ApplicationController layout 'admin' + before_action :check_enabled_deletion before_action :authenticate_user! def show @@ -21,6 +22,10 @@ class Settings::DeletesController < ApplicationController private + def check_enabled_deletion + redirect_to root_path unless Setting.open_deletion + end + def delete_params params.require(:form_delete_confirmation).permit(:password) end |