diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/hooks_controller.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb index 245c674f650..b668a9331e7 100644 --- a/app/controllers/projects/hooks_controller.rb +++ b/app/controllers/projects/hooks_controller.rb @@ -10,13 +10,11 @@ class Projects::HooksController < Projects::ApplicationController @hook = @project.hooks.new(hook_params) @hook.save - if @hook.valid? - redirect_to namespace_project_settings_integrations_path(@project.namespace, @project) - else + unless @hook.valid? @hooks = @project.hooks.select(&:persisted?) flash[:alert] = @hook.errors.full_messages.join.html_safe - redirect_to namespace_project_settings_integrations_path(@project.namespace, @project) end + redirect_to namespace_project_settings_integrations_path(@project.namespace, @project) end def test |