DEV: don't send moderator welcome message to first admin. (#26719)

We already skipping the admin welcome message for the first admin user. We should also skip the moderator message.
This commit is contained in:
Vinoth Kannan 2024-04-24 00:20:14 +05:30 committed by GitHub
parent efc31387e2
commit 859b55366f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -563,7 +563,7 @@ class User < ActiveRecord::Base
def enqueue_staff_welcome_message(role)
return unless staff?
return if role == :admin && User.real.where(admin: true).count == 1
return if is_singular_admin?
Jobs.enqueue(
:send_system_message,

View File

@ -34,6 +34,7 @@ RSpec.describe Jobs::EnableBootstrapMode do
StaffActionLogger.any_instance.expects(:log_site_setting_change).times(4)
Jobs::EnableBootstrapMode.new.execute(user_id: admin.id)
expect(admin.reload.moderator).to be_truthy
expect(Jobs::SendSystemMessage.jobs.size).to eq(0)
end
end
end