diff options
author | James Lopez <james@jameslopez.es> | 2016-04-27 16:01:55 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-04-27 16:01:55 +0300 |
commit | 34c826a3110700f401fac4242f6a5dd15884f33d (patch) | |
tree | 58231a6cc0ec848e71d6681d5951a90c35a37756 /app/controllers/import | |
parent | cbbc42e0c4e5888413a690a4e0760e3cadd55a63 (diff) |
some JS magic to pass namespace and path importing projects
Diffstat (limited to 'app/controllers/import')
-rw-r--r-- | app/controllers/import/gitlab_projects_controller.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/import/gitlab_projects_controller.rb b/app/controllers/import/gitlab_projects_controller.rb index 36be79a39c4..b141b5f472a 100644 --- a/app/controllers/import/gitlab_projects_controller.rb +++ b/app/controllers/import/gitlab_projects_controller.rb @@ -27,15 +27,18 @@ class Import::GitlabProjectsController < Import::BaseController end def create + # TODO verify access to namespace and path file = params[:file] + namespace_id = project_params[:namespace_id] + path = project_params[:path] repo_owner = current_user.username @target_namespace = params[:new_namespace].presence || repo_owner @project = Project.create_from_import_job(current_user_id: current_user.id, tmp_file: File.expand_path(file.path), - namespace_id: @namespace_id, - project_path: @path) + namespace_id: namespace_id, + project_path: path) end private @@ -45,7 +48,7 @@ class Import::GitlabProjectsController < Import::BaseController end def project_params - params.require(:project).permit( + params.permit( :path, :namespace_id, ) end |