summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2019-05-29 16:11:47 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2019-05-29 16:11:47 +0000
commit440c9665f3f6c0fad6ea3c57981379a17eec423e (patch)
treee9a6d6a6cb8d4850dac33ab92d7e652efc6abe2f
parent5dd3b753f5ee4a400c7e492f7bacf75ecfab7cb4 (diff)
parent02dc7fbfa40f9df03590b8f01ee2da4464d8437b (diff)
downloadgitlab-ce-440c9665f3f6c0fad6ea3c57981379a17eec423e.tar.gz
Merge branch 'id-fix-overriding-of-import-params' into '11-11-stable'
Fix the overriding of EE import params See merge request gitlab/gitlabhq!3129
-rw-r--r--app/controllers/concerns/import_url_params.rb7
-rw-r--r--app/controllers/projects/imports_controller.rb12
2 files changed, 12 insertions, 7 deletions
diff --git a/app/controllers/concerns/import_url_params.rb b/app/controllers/concerns/import_url_params.rb
index d9070e51573..765654ca2cb 100644
--- a/app/controllers/concerns/import_url_params.rb
+++ b/app/controllers/concerns/import_url_params.rb
@@ -2,12 +2,7 @@
module ImportUrlParams
def import_url_params
- import_params =
- params
- .require(:project)
- .permit(:import_url, :import_url_user, :import_url_password)
-
- { import_url: import_params_to_full_url(import_params) }
+ { import_url: import_params_to_full_url(params[:project]) }
end
def import_params_to_full_url(params)
diff --git a/app/controllers/projects/imports_controller.rb b/app/controllers/projects/imports_controller.rb
index 25a137eeb38..afbf9fd7720 100644
--- a/app/controllers/projects/imports_controller.rb
+++ b/app/controllers/projects/imports_controller.rb
@@ -14,7 +14,7 @@ class Projects::ImportsController < Projects::ApplicationController
end
def create
- if @project.update(import_url_params)
+ if @project.update(import_params)
@project.import_state.reset.schedule
end
@@ -66,4 +66,14 @@ class Projects::ImportsController < Projects::ApplicationController
redirect_to project_path(@project)
end
end
+
+ def import_params_attributes
+ []
+ end
+
+ def import_params
+ params.require(:project)
+ .permit(import_params_attributes)
+ .merge(import_url_params)
+ end
end