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

Set logged_by only if not present in args

Oliver Günthere865bd9c6ef2
diff --git a/modules/costs/app/services/time_entries/set_attributes_service.rb b/modules/costs/app/services/time_entries/set_attributes_service.rb
index 6ef416c27b7..0d787b8d6f3 100644
--- a/modules/costs/app/services/time_entries/set_attributes_service.rb
+++ b/modules/costs/app/services/time_entries/set_attributes_service.rb
@@ -38,14 +38,14 @@ module TimeEntries
if no_project_or_context_changed?
model.project = model.work_package&.project
end
-
- set_logged_by unless model.user_changed?
end
- def set_default_attributes(*)
+ def set_default_attributes(attributes)
set_default_user
set_default_activity
set_default_hours
+
+ set_logged_by unless attributes[:logged_by]
end
def set_logged_by