Commit 440c9665 authored by Yorick Peterse's avatar Yorick Peterse

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
parents 5dd3b753 02dc7fbf
...@@ -2,12 +2,7 @@ ...@@ -2,12 +2,7 @@
module ImportUrlParams module ImportUrlParams
def import_url_params def import_url_params
import_params = { import_url: import_params_to_full_url(params[:project]) }
params
.require(:project)
.permit(:import_url, :import_url_user, :import_url_password)
{ import_url: import_params_to_full_url(import_params) }
end end
def import_params_to_full_url(params) def import_params_to_full_url(params)
......
...@@ -14,7 +14,7 @@ class Projects::ImportsController < Projects::ApplicationController ...@@ -14,7 +14,7 @@ class Projects::ImportsController < Projects::ApplicationController
end end
def create def create
if @project.update(import_url_params) if @project.update(import_params)
@project.import_state.reset.schedule @project.import_state.reset.schedule
end end
...@@ -66,4 +66,14 @@ class Projects::ImportsController < Projects::ApplicationController ...@@ -66,4 +66,14 @@ class Projects::ImportsController < Projects::ApplicationController
redirect_to project_path(@project) redirect_to project_path(@project)
end end
end end
def import_params_attributes
[]
end
def import_params
params.require(:project)
.permit(import_params_attributes)
.merge(import_url_params)
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment