diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2015-12-07 22:41:18 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2015-12-07 22:41:18 -0200 |
commit | f7aafd8fc8e1dd3a414e3827c42087b364ebd5a0 (patch) | |
tree | 5b13c5d00dbc7590eec668b91b74fbc21b044f9f /lib/api/projects.rb | |
parent | 7d836a0c0ae2869a6b915234d347d15e25a511fe (diff) | |
parent | e02940e32941cc253f713ef3fe0aac896c9342ac (diff) | |
download | gitlab-ce-f7aafd8fc8e1dd3a414e3827c42087b364ebd5a0.tar.gz |
Merge branch 'master' into fix-merge-request-that-removes-submodulefix-merge-request-that-removes-submodule
Diffstat (limited to 'lib/api/projects.rb')
-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 |