summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2015-03-07 11:23:43 -0700
committerVinnie Okada <vokada@mrvinn.com>2015-03-08 16:10:05 -0600
commit285c5341855f8af6cbea5e964e3104a4698fa450 (patch)
treea73054190f441edcda4c33715c7822caeb7800ed /lib/api/helpers.rb
parentcacac147de2b317d02788c5da1cdc6010f00a340 (diff)
downloadgitlab-ce-285c5341855f8af6cbea5e964e3104a4698fa450.tar.gz
Allow admins to override restricted visibility
Allow admins to use restricted visibility levels when creating or updating projects.
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 228a719fbdf..f46dc8b456e 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -204,7 +204,7 @@ module API
end
def render_validation_error!(model)
- unless model.valid?
+ if model.errors.any?
render_api_error!(model.errors.messages || '400 Bad Request', 400)
end
end