Commit 2144ffdc authored by jboyson's avatar jboyson

Fix: only redirect on success

Also no need to reset project anymore
parent d91bac2a
......@@ -92,12 +92,12 @@ class ProjectsController < Projects::ApplicationController
if result[:status] == :success
flash[:notice] = _("Project '%{project_name}' was successfully updated.") % { project_name: @project.name }
redirect_to(edit_project_path(@project, anchor: 'js-general-project-settings'))
else
flash[:alert] = result[:message]
@project.reset
render 'edit'
end
redirect_to(edit_project_path(@project, anchor: 'js-general-project-settings'))
end
# rubocop: disable CodeReuse/ActiveRecord
......
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