summaryrefslogtreecommitdiff
path: root/app/controllers/projects/services_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/services_controller.rb')
-rw-r--r--app/controllers/projects/services_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb
index daa5c88aae0..b0da0d4dac5 100644
--- a/app/controllers/projects/services_controller.rb
+++ b/app/controllers/projects/services_controller.rb
@@ -3,6 +3,7 @@ class Projects::ServicesController < Projects::ApplicationController
# Authorize
before_action :authorize_admin_project!
+ before_action :ensure_service_enabled
before_action :service, only: [:edit, :update, :test]
respond_to :html
@@ -54,4 +55,8 @@ class Projects::ServicesController < Projects::ApplicationController
def service
@service ||= @project.find_or_initialize_service(params[:id])
end
+
+ def ensure_service_enabled
+ render_404 unless service
+ end
end