diff options
author | Rubén Dávila <ruben@gitlab.com> | 2017-08-22 11:05:02 -0500 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2017-08-22 11:05:02 -0500 |
commit | e6880ebc7d399627d6b77fb3483b8e7157932313 (patch) | |
tree | 4bfade8ccffcb713959f3b15673c6701911ac629 /app/controllers/projects/services_controller.rb | |
parent | 539ed0a6375d5bb6d734e688b801373e4b8006f9 (diff) | |
download | gitlab-ce-e6880ebc7d399627d6b77fb3483b8e7157932313.tar.gz |
Fix inability to test some project integrationsfix-broken-testing-of-some-integrations
Diffstat (limited to 'app/controllers/projects/services_controller.rb')
-rw-r--r-- | app/controllers/projects/services_controller.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb index d54a1111f11..daa5c88aae0 100644 --- a/app/controllers/projects/services_controller.rb +++ b/app/controllers/projects/services_controller.rb @@ -4,7 +4,6 @@ class Projects::ServicesController < Projects::ApplicationController # Authorize before_action :authorize_admin_project! before_action :service, only: [:edit, :update, :test] - before_action :update_service, only: [:update, :test] respond_to :html @@ -14,6 +13,8 @@ class Projects::ServicesController < Projects::ApplicationController end def update + @service.attributes = service_params[:service] + if @service.save(context: :manual_change) redirect_to(project_settings_integrations_path(@project), notice: success_message) else @@ -24,7 +25,7 @@ class Projects::ServicesController < Projects::ApplicationController def test message = {} - if @service.can_test? + if @service.can_test? && @service.update_attributes(service_params[:service]) data = @service.test_data(project, current_user) outcome = @service.test(data) @@ -50,10 +51,6 @@ class Projects::ServicesController < Projects::ApplicationController end end - def update_service - @service.assign_attributes(service_params[:service]) - end - def service @service ||= @project.find_or_initialize_service(params[:id]) end |