diff options
author | Vinnie Okada <vokada@mrvinn.com> | 2015-03-07 21:23:43 +0300 |
---|---|---|
committer | Vinnie Okada <vokada@mrvinn.com> | 2015-03-09 01:10:05 +0300 |
commit | 285c5341855f8af6cbea5e964e3104a4698fa450 (patch) | |
tree | a73054190f441edcda4c33715c7822caeb7800ed /lib/api/projects.rb | |
parent | cacac147de2b317d02788c5da1cdc6010f00a340 (diff) |
Allow admins to override restricted visibility
Allow admins to use restricted visibility levels when creating or
updating projects.
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 0677e85beab..83f65eec6cc 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -233,10 +233,10 @@ module API ::Projects::UpdateService.new(user_project, current_user, attrs).execute - if user_project.valid? - present user_project, with: Entities::Project - else + if user_project.errors.any? render_validation_error!(user_project) + else + present user_project, with: Entities::Project end end |