gitlab-org--gitlab-foss/app/services/projects/create_from_template_service.rb
George Tsiolis ca5b4e3de2 Update projects import service
- Remove Gitlab::ImportExport::ProjectCreator from GitlabProjectsImportService
- Override ::Projects::CreateService params
2018-02-12 17:45:12 +02:00

19 lines
429 B
Ruby

module Projects
class CreateFromTemplateService < BaseService
def initialize(user, params)
@current_user, @params = user, params.dup
end
def execute
template_name = params.delete(:template_name)
file = Gitlab::ProjectTemplate.find(template_name).file
params[:file] = file
GitlabProjectsImportService.new(current_user, params).execute
ensure
file&.close
end
end
end