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

Avoid trying to log time for missing changeset user

Oliver Günther5a358d9290d6
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index 2d07f61f537..e8ee7a675bf 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -240,6 +240,11 @@ class Changeset < ActiveRecord::Base
end
def log_time(work_package, hours)
+ unless user.present?
+ Rails.logger.warn("TimeEntry could not be created by changeset #{id}: #{committer} does not map to user")
+ return
+ end
+
Changesets::LogTimeService
.new(user: user, changeset: self)
.call(work_package, hours)