summaryrefslogtreecommitdiff
path: root/django/utils/log.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-11-10 23:21:31 +0200
committerTim Graham <timograham@gmail.com>2014-11-15 09:38:19 +0100
commitd552da1f8d42b7c6db992fee42bc4781f5fdde43 (patch)
treedadee4405fb21d346345530cedc2a01d19dab89b /django/utils/log.py
parenta305695f28cb15165a19c3871aec878a230a5105 (diff)
Fixed #22407 -- Added AdminEmailHandler.send_mail().
Diffstat (limited to 'django/utils/log.py')
-rw-r--r--django/utils/log.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/utils/log.py b/django/utils/log.py
index a2296a3281..6ced3a4a63 100644
--- a/django/utils/log.py
+++ b/django/utils/log.py
@@ -127,9 +127,10 @@ class AdminEmailHandler(logging.Handler):
message = "%s\n\nRequest repr(): %s" % (self.format(record), request_repr)
reporter = ExceptionReporter(request, is_email=True, *exc_info)
html_message = reporter.get_traceback_html() if self.include_html else None
- mail.mail_admins(subject, message, fail_silently=True,
- html_message=html_message,
- connection=self.connection())
+ self.send_mail(subject, message, fail_silently=True, html_message=html_message)
+
+ def send_mail(self, subject, message, *args, **kwargs):
+ mail.mail_admins(subject, message, *args, connection=self.connection(), **kwargs)
def connection(self):
return get_connection(backend=self.email_backend, fail_silently=True)