Commit 81f7a7ab 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 28f633a9
......@@ -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
---
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
......
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