skip mail_admins/mail_managers if ADMINS or MANAGERS is empty
|Reported by:||Jesse Young||Owned by:||nobody|
|Severity:||Keywords:||500 error mail_admins|
|Cc:||Malcolm Tredinnick||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
As discussed on http://groups.google.com/group/django-developers/browse_thread/thread/5c27ac4703da33a9, when DEBUG = False, internal server errors will always cause mail_admins to be called (unless overridden in a custom handler class), and the current implementation of mail_admins always opens a connection to the SMTP server even if the email has no recipients (i.e., ADMINS=).
This patch makes mail_admins and mail_managers a no-op if there are no recipients. It also avoids constructing the internal server error email if it has no recipients.
Change History (9)
comment:1 Changed 8 years ago by
|Component:||HTTP handling → Core framework|
|Patch needs improvement:||set|
|Triage Stage:||Unreviewed → Accepted|