Commit 0fc9ea6f authored by sandish chen's avatar sandish chen Committed by Rémy Coutable

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: default avatarRémy Coutable <remy@rymai.me>
parent 3e36c53c
......@@ -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(
......
......@@ -31,6 +31,7 @@ module Projects
project.rename_repo
end
end
project
end
end
end
---
title: Fix none display notice when project settings updated
merge_request:
author: Sandish Chen
......@@ -266,7 +266,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
......
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