Fix to display notice when project settings updated.
Change validity checking for UpdateService. Add return value for project update service. Return 302(redirect_to) when successfully updated. Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
28f633a96a
commit
81f7a7ab62
|
@ -42,13 +42,13 @@ class ProjectsController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
status = ::Projects::UpdateService.new(@project, current_user, project_params).execute
|
||||
project = ::Projects::UpdateService.new(@project, current_user, project_params).execute
|
||||
|
||||
# Refresh the repo in case anything changed
|
||||
@repository = project.repository
|
||||
|
||||
respond_to do |format|
|
||||
if status
|
||||
if project.valid?
|
||||
flash[:notice] = "Project '#{@project.name}' was successfully updated."
|
||||
format.html do
|
||||
redirect_to(
|
||||
|
|
|
@ -24,6 +24,7 @@ module Projects
|
|||
project.rename_repo
|
||||
end
|
||||
end
|
||||
project
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Fix none display notice when project settings updated
|
||||
merge_request:
|
||||
author: Sandish Chen
|
|
@ -245,7 +245,7 @@ describe ProjectsController do
|
|||
|
||||
expect(project.repository.path).to include(new_path)
|
||||
expect(assigns(:repository).path).to eq(project.repository.path)
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response).to have_http_status(302)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue