| ... | @@ -47,7 +47,7 @@ class ProjectsController < Projects::ApplicationController |
... | @@ -47,7 +47,7 @@ class ProjectsController < Projects::ApplicationController |
|
|
end
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
def create
|
|
|
@project = ::Projects::CreateService.new(current_user, project_params).execute
|
|
@project = ::Projects::CreateService.new(current_user, project_params(attributes: project_params_create_attributes)).execute
|
|
|
|
|
|
|
|
if @project.saved?
|
|
if @project.saved?
|
|
|
cookies[:issue_board_welcome_hidden] = { path: project_path(@project), value: nil, expires: Time.at(0) }
|
|
cookies[:issue_board_welcome_hidden] = { path: project_path(@project), value: nil, expires: Time.at(0) }
|
| ... | @@ -328,9 +328,9 @@ class ProjectsController < Projects::ApplicationController |
... | @@ -328,9 +328,9 @@ class ProjectsController < Projects::ApplicationController |
|
|
end
|
|
end
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
|
|
|
|
|
|
def project_params
|
|
def project_params(attributes: [])
|
|
|
params.require(:project)
|
|
params.require(:project)
|
|
|
.permit(project_params_attributes)
|
|
.permit(project_params_attributes + attributes)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
def project_params_attributes
|
|
def project_params_attributes
|
| ... | @@ -349,11 +349,10 @@ class ProjectsController < Projects::ApplicationController |
... | @@ -349,11 +349,10 @@ class ProjectsController < Projects::ApplicationController |
|
|
:last_activity_at,
|
|
:last_activity_at,
|
|
|
:lfs_enabled,
|
|
:lfs_enabled,
|
|
|
:name,
|
|
:name,
|
|
|
:namespace_id,
|
|
|
|
|
:only_allow_merge_if_all_discussions_are_resolved,
|
|
:only_allow_merge_if_all_discussions_are_resolved,
|
|
|
:only_allow_merge_if_pipeline_succeeds,
|
|
:only_allow_merge_if_pipeline_succeeds,
|
|
|
:printing_merge_request_link_enabled,
|
|
|
|
|
:path,
|
|
:path,
|
|
|
|
:printing_merge_request_link_enabled,
|
|
|
:public_builds,
|
|
:public_builds,
|
|
|
:request_access_enabled,
|
|
:request_access_enabled,
|
|
|
:runners_token,
|
|
:runners_token,
|
| ... | @@ -375,6 +374,10 @@ class ProjectsController < Projects::ApplicationController |
... | @@ -375,6 +374,10 @@ class ProjectsController < Projects::ApplicationController |
|
|
]
|
|
]
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
def project_params_create_attributes
|
|
|
|
[:namespace_id]
|
|
|
|
end
|
|
|
|
|
|
|
def custom_import_params
|
|
def custom_import_params
|
|
|
{}
|
|
{}
|
|
|
end
|
|
end
|
| ... | |
... | |
| ... | | ... | |