mirror of
https://github.com/discourse/discourse.git
synced 2025-03-03 09:49:42 +00:00
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:
parent
efc31387e2
commit
859b55366f
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user