mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 18:13:39 +08:00
FIX: staged users should get emails on must_approve_users sites
This commit is contained in:
parent
41e7bdff38
commit
50203794e6
|
@ -79,7 +79,7 @@ class NotificationEmailer
|
|||
def perform_enqueue(type, delay)
|
||||
user = notification.user
|
||||
return unless user.active? || user.staged?
|
||||
return if SiteSetting.must_approve_users? && !user.approved?
|
||||
return if SiteSetting.must_approve_users? && !user.approved? && !user.staged?
|
||||
|
||||
return unless EMAILABLE_POST_TYPES.include?(post_type)
|
||||
|
||||
|
|
|
@ -39,6 +39,14 @@ describe NotificationEmailer do
|
|||
Jobs.expects(:enqueue_in).with(delay, :user_email, NotificationEmailer::EmailUser.notification_params(notification, type))
|
||||
NotificationEmailer.process_notification(notification)
|
||||
end
|
||||
|
||||
it "enqueues a job if the user is staged even if site requires user approval" do
|
||||
SiteSetting.must_approve_users = true
|
||||
|
||||
notification.user.staged = true
|
||||
Jobs.expects(:enqueue_in).with(delay, :user_email, NotificationEmailer::EmailUser.notification_params(notification, type))
|
||||
NotificationEmailer.process_notification(notification)
|
||||
end
|
||||
end
|
||||
|
||||
context "active but unapproved user" do
|
||||
|
|
Loading…
Reference in New Issue
Block a user