Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

no validation on copy project get action

ulferts29a70ae5630a
diff --git a/app/controllers/copy_projects_controller.rb b/app/controllers/copy_projects_controller.rb
index 2e984d5c3fb..802d071c5ab 100644
--- a/app/controllers/copy_projects_controller.rb
+++ b/app/controllers/copy_projects_controller.rb
@@ -50,7 +50,7 @@ class CopyProjectsController < ApplicationController
@copy_project = Project.copy_attributes(@project)
if @copy_project
- @errors = project_copy(@copy_project).errors
+ project_copy(@copy_project, EmptyContract)
render action: copy_action
else
@@ -68,11 +68,11 @@ class CopyProjectsController < ApplicationController
"copy_from_#{from}"
end
- def project_copy(nucleous)
+ def project_copy(nucleous, contract = Projects::CreateContract)
Projects::SetAttributesService
.new(user: current_user,
model: nucleous,
- contract_class: Projects::CreateContract)
+ contract_class: contract)
.call(params[:project] ? permitted_params.project : {})
end