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

pass user exclipictly in ApplyWorkingDaysChangeJob

Ivan Kuchin3aadf2b2fdf5
diff --git a/app/workers/projects/phases/apply_working_days_change_job.rb b/app/workers/projects/phases/apply_working_days_change_job.rb
index e49fdb1d0ca..83c01d6863c 100644
--- a/app/workers/projects/phases/apply_working_days_change_job.rb
+++ b/app/workers/projects/phases/apply_working_days_change_job.rb
@@ -32,8 +32,6 @@ class Projects::Phases::ApplyWorkingDaysChangeJob < ApplyWorkingDaysChangeJobBas
private
def apply_working_days_change
- user = User.current
-
applicable_phases.distinct.pluck(:project_id).each do |project_id|
project = Project.find_by(id: project_id)
next unless project
@@ -42,7 +40,7 @@ class Projects::Phases::ApplyWorkingDaysChangeJob < ApplyWorkingDaysChangeJobBas
from = phases.filter_map(&:start_date).first
next unless from
- ProjectLifeCycleSteps::RescheduleService.new(user:, project:).call(phases:, from:)
+ ProjectLifeCycleSteps::RescheduleService.new(user: User.current, project:).call(phases:, from:)
project.journal_cause = journal_cause