Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-01-16 21:28:23 +0300
committerRobert Speicher <robert@gitlab.com>2017-01-16 21:28:23 +0300
commit55b3ee74396799c9a847d4aef2cd9d19cfa9aed1 (patch)
treeb3e7d817b617d2835ae631ba9a531080d20d1875 /lib/api
parent0a52c40b43020bc2bd014bece02a760bfa09d15c (diff)
parent7485cec94e3bcc98880fdf51760c646a0e27c5b3 (diff)
Merge branch 'sandish/gitlab-ce-update_ret_val' into 'master'
Ensure updating project settings shows a flash message on success See merge request !8579
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/projects.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 7c66c340562..941f47114a4 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -295,13 +295,13 @@ module API
authorize! :rename_project, user_project if attrs[:name].present?
authorize! :change_visibility_level, user_project if attrs[:visibility_level].present?
- ::Projects::UpdateService.new(user_project, current_user, attrs).execute
+ result = ::Projects::UpdateService.new(user_project, current_user, attrs).execute
- if user_project.errors.any?
- render_validation_error!(user_project)
- else
+ if result[:status] == :success
present user_project, with: Entities::Project,
user_can_admin_project: can?(current_user, :admin_project, user_project)
+ else
+ render_validation_error!(user_project)
end
end