Skip to content
Browse files

Fixed #19637 -- Ensured AdminEmailHandler fails silently

Thanks lsaffre for the report. Refs #19325.
  • Loading branch information...
1 parent 7aa5383 commit c6e0dedbdb22f4db6577886a2b67e5423684fe7f @claudep claudep committed
Showing with 5 additions and 1 deletion.
  1. +1 −1 django/utils/log.py
  2. +4 −0 tests/regressiontests/logging_tests/tests.py
View
2 django/utils/log.py
@@ -117,7 +117,7 @@ def emit(self, record):
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):
"""
View
4 tests/regressiontests/logging_tests/tests.py
@@ -154,6 +154,10 @@ def get_admin_email_handler(self, logger):
][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-'

0 comments on commit c6e0ded

Please sign in to comment.
Something went wrong with that request. Please try again.