Commit 02dc7fbf authored by Igor Drozdov's avatar Igor Drozdov Committed by Yorick Peterse

Fix the overriding of EE import params

parent 5dd3b753
...@@ -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