diff options
author | Rémy Coutable <remy@rymai.me> | 2017-01-15 01:58:05 -0500 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-01-16 10:57:15 -0500 |
commit | 7485cec94e3bcc98880fdf51760c646a0e27c5b3 (patch) | |
tree | eccf6ef15c4fe5a0492ed3730152160ecccdd398 /lib | |
parent | 81f7a7ab62edf33234e7eb10834828ecd1793cb4 (diff) | |
download | gitlab-ce-7485cec94e3bcc98880fdf51760c646a0e27c5b3.tar.gz |
Add a spec and actually display the flash notice
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/projects.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 3be14e8eb76..c931ec65339 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 |