Commit 21bf8555 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'sh-omit-blocked-admins-from-notification' into 'master'

Omit blocked admins from repository check e-mails

Closes #63019

See merge request gitlab-org/gitlab-ce!29507
parents e7a59b87 ede04582
......@@ -15,7 +15,7 @@ class RepositoryCheckMailer < BaseMailer
end
mail(
to: User.admins.pluck(:email),
to: User.admins.active.pluck(:email),
subject: "GitLab Admin | #{@message}"
)
end
......
---
title: Omit blocked admins from repository check e-mails
merge_request: 29507
author:
type: fixed
......@@ -12,6 +12,16 @@ describe RepositoryCheckMailer do
expect(mail).to deliver_to admins.map(&:email)
end
it 'omits blocked admins' do
blocked = create(:admin, :blocked)
admins = create_list(:admin, 3)
mail = described_class.notify(1)
expect(mail.to).not_to include(blocked.email)
expect(mail).to deliver_to admins.map(&:email)
end
it 'mentions the number of failed checks' do
mail = described_class.notify(3)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment