diff options
author | James Lopez <james@jameslopez.es> | 2016-06-14 13:47:07 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-06-14 13:47:07 +0300 |
commit | 3f7ed550110daaec8a76af7146b701dfc0210e60 (patch) | |
tree | 25fa93f0c306f8ea2ab9b28f26dfb11bb7551184 /app/controllers/import | |
parent | 1ea44ee75077d67f3f24a288cc44d7c275ba8581 (diff) |
lots of refactoring to reuse import service
Diffstat (limited to 'app/controllers/import')
-rw-r--r-- | app/controllers/import/gitlab_projects_controller.rb | 10 |
1 files changed, 4 insertions, 6 deletions
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." |