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

Ensure the user is marked as active in automatic activiation

Oliver Günther4d66b7c4254d
diff --git a/app/services/users/register_user_service.rb b/app/services/users/register_user_service.rb
index bbc20714b0e..074e8a2d3ea 100644
--- a/app/services/users/register_user_service.rb
+++ b/app/services/users/register_user_service.rb
@@ -98,6 +98,8 @@ module Users
def register_automatically
return unless Setting::SelfRegistration.automatic?
+ user.activate
+
with_saved_user_result do
Rails.logger.info { "User #{user.login} was successfully activated." }
end
@@ -132,7 +134,7 @@ module Users
end
ServiceResult.new(success: false, result: user).tap do |result|
- result.errors.add(:user, :invalid)
+ result.errors.add(:base, :failed_to_activate)
end
end
end