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 using the user errors to mark activation failed

Oliver Günther235e8ab87c2d
diff --git a/app/services/users/register_user_service.rb b/app/services/users/register_user_service.rb
index fb21d1a4b61..3c1759674e1 100644
--- a/app/services/users/register_user_service.rb
+++ b/app/services/users/register_user_service.rb
@@ -139,8 +139,10 @@ module Users
return ServiceResult.new(success: true, result: user, message: success_message)
end
- ServiceResult.new(success: false, result: user).tap do |result|
- result.errors.add(:base, :failed_to_activate)
+ ServiceResult.new(success: false).tap do |call|
+ # Avoid using the errors from the user
+ call.result = user
+ call.errors.add(:base, I18n.t(:notice_activation_failed), error_symbol: :failed_to_activate)
end
end
end