Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #19637 -- Ensured AdminEmailHandler fails silently

Thanks lsaffre for the report. Refs #19325.
  • Loading branch information...
commit c6e0dedbdb22f4db6577886a2b67e5423684fe7f 1 parent 7aa5383
Claude Paroz claudep authored
2  django/utils/log.py
View
@@ -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):
"""
4 tests/regressiontests/logging_tests/tests.py
View
@@ -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-'
Please sign in to comment.
Something went wrong with that request. Please try again.