Commit ede04582 authored by Stan Hu's avatar Stan Hu

Omit blocked admins from repository check e-mails

Blocked admins should not receive notifications about failed repository
checks.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63019
parent b05de5a5
......@@ -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