Fixed #19637 -- Ensured AdminEmailHandler fails silently
Thanks lsaffre for the report. Refs #19325.
This commit is contained in:
parent
7aa538357c
commit
c6e0dedbdb
|
@ -117,7 +117,7 @@ class AdminEmailHandler(logging.Handler):
|
|||
connection=self.connection())
|
||||
|
||||
def connection(self):
|
||||
return get_connection(backend=self.email_backend)
|
||||
return get_connection(backend=self.email_backend, fail_silently=True)
|
||||
|
||||
def format_subject(self, subject):
|
||||
"""
|
||||
|
|
|
@ -154,6 +154,10 @@ class AdminEmailHandlerTest(TestCase):
|
|||
][0]
|
||||
return admin_email_handler
|
||||
|
||||
def test_fail_silently(self):
|
||||
admin_email_handler = self.get_admin_email_handler(self.logger)
|
||||
self.assertTrue(admin_email_handler.connection().fail_silently)
|
||||
|
||||
@override_settings(
|
||||
ADMINS=(('whatever admin', 'admin@example.com'),),
|
||||
EMAIL_SUBJECT_PREFIX='-SuperAwesomeSubject-'
|
||||
|
|
Loading…
Reference in New Issue