diff options
author | James Lopez <james@jameslopez.es> | 2018-01-03 09:10:43 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-01-03 09:10:43 +0100 |
commit | f2d4b24a9404a1439d4f4c983fdf9ca000ac6e21 (patch) | |
tree | fa9f3bd98f0f44a2afea85ea03f18afe1fbe5a2f /app/services | |
parent | 11d0083e95b9dc22c27f368e38058ec3e0a40f46 (diff) | |
download | gitlab-ce-f2d4b24a9404a1439d4f4c983fdf9ca000ac6e21.tar.gz |
refactor code to use new import type
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/projects/create_service.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index 4ed65982326..52b90cdf135 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -12,7 +12,6 @@ module Projects forked_from_project_id = params.delete(:forked_from_project_id) import_data = params.delete(:import_data) @skip_wiki = params.delete(:skip_wiki) - @skip_import = params.delete(:skip_import) @project = Project.new(params) @@ -88,7 +87,7 @@ module Projects def after_create_actions log_info("#{@project.owner.name} created a new project \"#{@project.name_with_namespace}\"") - if !@project.gitlab_project_import? || @skip_import + unless @project.gitlab_project_import? @project.create_wiki unless skip_wiki? create_services_from_active_templates(@project) @@ -121,7 +120,7 @@ module Projects Project.transaction do @project.create_or_update_import_data(data: import_data[:data], credentials: import_data[:credentials]) if import_data - if @project.save && !@project.import? + if @project.save && !@project.import? && !@project.bare_repository_import? raise 'Failed to create repository' unless @project.create_repository end end @@ -166,7 +165,7 @@ module Projects def import_schedule if @project.errors.empty? - @project.import_schedule if @project.import? && !@skip_import + @project.import_schedule if @project.import? else fail(error: @project.errors.full_messages.join(', ')) end |