diff options
author | James Lopez <james@jameslopez.es> | 2016-04-26 18:12:50 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-04-26 18:12:50 +0300 |
commit | cbbc42e0c4e5888413a690a4e0760e3cadd55a63 (patch) | |
tree | 0207565a8c4120916936439f209d213ddf06fb92 /app/controllers/import | |
parent | 1d4c3fa1507fdfdecdc15091ac8ef8d9f5fb63d9 (diff) |
adding more UI changes, updated controller, worker and refactored import service
Diffstat (limited to 'app/controllers/import')
-rw-r--r-- | app/controllers/import/gitlab_projects_controller.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/app/controllers/import/gitlab_projects_controller.rb b/app/controllers/import/gitlab_projects_controller.rb index 0e94915765c..36be79a39c4 100644 --- a/app/controllers/import/gitlab_projects_controller.rb +++ b/app/controllers/import/gitlab_projects_controller.rb @@ -7,7 +7,8 @@ class Import::GitlabProjectsController < Import::BaseController #TODO permissions stuff def new - + @namespace_id = project_params[:namespace_id] + @path = project_params[:path] end def status @@ -27,14 +28,14 @@ class Import::GitlabProjectsController < Import::BaseController def create file = params[:file] - # @project_name = repo_owner = current_user.username @target_namespace = params[:new_namespace].presence || repo_owner - namespace = get_or_create_namespace || (render and return) - - @project = Project.create_from_import_job(current_user.id, File.expand_path(file.path)) + @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) end private @@ -42,4 +43,10 @@ class Import::GitlabProjectsController < Import::BaseController def verify_gitlab_project_import_enabled render_404 unless gitlab_project_import_enabled? end + + def project_params + params.require(:project).permit( + :path, :namespace_id, + ) + end end |