Commit 26fdcf7b authored by Daniel Wyatt's avatar Daniel Wyatt

Fix GitHub project import visibility

parent 34f68b3e
---
title: Fix GitHub project import visibility
merge_request:
author: Daniel Wyatt
type: fixed
......@@ -37,7 +37,7 @@ module Gitlab
end
def visibility_level
visibility_level = repo.private ? Gitlab::VisibilityLevel::PRIVATE : Gitlab::VisibilityLevel::PUBLIC
visibility_level = repo.private ? Gitlab::VisibilityLevel::PRIVATE : @namespace.visibility_level
visibility_level = Gitlab::CurrentSettings.default_project_visibility if Gitlab::CurrentSettings.restricted_visibility_levels.include?(visibility_level)
visibility_level
......
......@@ -47,12 +47,12 @@ describe Gitlab::LegacyGithubImport::ProjectCreator do
end
context 'when GitHub project is public' do
it 'sets project visibility to public' do
it 'sets project visibility to namespace visibility level' do
repo.private = false
project = service.execute
expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
expect(project.visibility_level).to eq(namespace.visibility_level)
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment