mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #35364 -- Stopped AdminEmailHandler rendering email unnecessarily.
This commit is contained in:
committed by
Sarah Boyce
parent
b0f2289426
commit
50a702f3fd
@@ -92,6 +92,13 @@ class AdminEmailHandler(logging.Handler):
|
||||
)
|
||||
|
||||
def emit(self, record):
|
||||
# Early return when no email will be sent.
|
||||
if (
|
||||
not settings.ADMINS
|
||||
# Method not overridden.
|
||||
and self.send_mail.__func__ is AdminEmailHandler.send_mail
|
||||
):
|
||||
return
|
||||
try:
|
||||
request = record.request
|
||||
subject = "%s (%s IP): %s" % (
|
||||
|
||||
Reference in New Issue
Block a user