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

Run CopyProjectJob for instantiating template with pararms

Oliver Günther382befc8beb9
diff --git a/app/services/projects/instantiate_template_service.rb b/app/services/projects/instantiate_template_service.rb
index 23f51e7c9f0..5da4d9ad0b0 100644
--- a/app/services/projects/instantiate_template_service.rb
+++ b/app/services/projects/instantiate_template_service.rb
@@ -41,8 +41,17 @@ module Projects
end
def after_validate(params, call)
- # TODO
- warn "Scheduling job for #{params.inspect} to create template copy from #{template_project.inspect}"
+ ::CopyProjectJob.perform_later(
+ user_id: user.id,
+ source_project_id: template_project.id,
+ target_project_params: params,
+ # Copy all associations
+ associations_to_copy: nil,
+ # Send mails for now until we send our own mails
+ send_mails: true
+ )
+
+ call
end
# Do not actually try to save the project here