diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-08 15:22:04 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-08 15:22:04 +0100 |
commit | 15925290eec4f5616e12ef3169794f85150e3270 (patch) | |
tree | b1adb5784f74a05491a38b8656e179f451b79e5e /lib/api | |
parent | 0c3f70acf4838194f517c02874b8423303c21b48 (diff) | |
parent | 51ed5225adf4aac3ccbf715f8647258dac784abb (diff) | |
download | gitlab-ce-15925290eec4f5616e12ef3169794f85150e3270.tar.gz |
Merge branch 'master' into ui/dashboard-new-issueui/dashboard-new-issue
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/projects.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 2b4ada6e2eb..6928fe0eb9d 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -7,8 +7,12 @@ module API helpers do def map_public_to_visibility_level(attrs) publik = attrs.delete(:public) - publik = parse_boolean(publik) - attrs[:visibility_level] = Gitlab::VisibilityLevel::PUBLIC if !attrs[:visibility_level].present? && publik == true + if publik.present? && !attrs[:visibility_level].present? + publik = parse_boolean(publik) + # Since setting the public attribute to private could mean either + # private or internal, use the more conservative option, private. + attrs[:visibility_level] = (publik == true) ? Gitlab::VisibilityLevel::PUBLIC : Gitlab::VisibilityLevel::PRIVATE + end attrs end end |