diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-07 19:24:14 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-07 19:24:14 +0000 |
commit | 4c8b666893aa9f5ab94b800489fd9e3240ad4f5e (patch) | |
tree | 4c499f649a9b3461963d9c084333259aad8a57be /app/controllers | |
parent | 4e2b630df716174ea9b07319a0fd5eda7b60cf8e (diff) | |
parent | ae5003a35ef47bbdafc51e3e9d0f27039f9d20a2 (diff) | |
download | gitlab-ce-4c8b666893aa9f5ab94b800489fd9e3240ad4f5e.tar.gz |
Merge branch 'zj-project-templates' into 'master'
Allow projects to be started from a template
Closes #32420
See merge request !13108
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/import/gitlab_projects_controller.rb | 10 | ||||
-rw-r--r-- | app/controllers/projects_controller.rb | 1 |
2 files changed, 2 insertions, 9 deletions
diff --git a/app/controllers/import/gitlab_projects_controller.rb b/app/controllers/import/gitlab_projects_controller.rb index 36d246d185b..510813846a4 100644 --- a/app/controllers/import/gitlab_projects_controller.rb +++ b/app/controllers/import/gitlab_projects_controller.rb @@ -12,15 +12,7 @@ class Import::GitlabProjectsController < Import::BaseController return redirect_back_or_default(options: { alert: "You need to upload a GitLab project export archive." }) end - import_upload_path = Gitlab::ImportExport.import_upload_path(filename: project_params[:file].original_filename) - - FileUtils.mkdir_p(File.dirname(import_upload_path)) - FileUtils.copy_entry(project_params[:file].path, import_upload_path) - - @project = Gitlab::ImportExport::ProjectCreator.new(project_params[:namespace_id], - current_user, - import_upload_path, - project_params[:path]).execute + @project = ::Projects::GitlabProjectsImportService.new(current_user, project_params).execute if @project.saved? redirect_to( diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 2d7cbd4614e..0bffae6decd 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -324,6 +324,7 @@ class ProjectsController < Projects::ApplicationController :runners_token, :tag_list, :visibility_level, + :template_name, project_feature_attributes: %i[ builds_access_level |