From 3f7ed550110daaec8a76af7146b701dfc0210e60 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Tue, 14 Jun 2016 12:47:07 +0200 Subject: lots of refactoring to reuse import service --- app/controllers/import/gitlab_projects_controller.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'app/controllers/import') diff --git a/app/controllers/import/gitlab_projects_controller.rb b/app/controllers/import/gitlab_projects_controller.rb index 90b4ff8b2ca..98a9b5f1018 100644 --- a/app/controllers/import/gitlab_projects_controller.rb +++ b/app/controllers/import/gitlab_projects_controller.rb @@ -12,12 +12,10 @@ class Import::GitlabProjectsController < Import::BaseController return redirect_back_or_default(options: { alert: "You need to upload a GitLab project export archive." }) end - @project = Project.create_from_import_job(current_user_id: current_user.id, - tmp_file: File.expand_path(params[:file].path), - namespace_id: project_params[:namespace_id], - project_path: project_params[:path]) - - @project = Gitlab::GitlabImport::ProjectCreator.new(repo, namespace, current_user, access_params).execute + @project = Gitlab::GitlabImport::ProjectCreator.new(Namespace.find(project_params[:namespace_id]), + current_user, + File.expand_path(params[:file].path), + project_params[:path]).execute flash[:notice] = "The project import has been started." -- cgit v1.2.3