diff mbox

[2/3] settings: Also define SERVER_EMAIL for email logs

Message ID 1443437913-20260-3-git-send-email-damien.lespiau@intel.com
State Superseded
Headers show

Commit Message

Damien Lespiau Sept. 28, 2015, 10:58 a.m. UTC
Django can send emails to admins on 500 HTTP errors when DEBUG is false.
That looks handy. That mechanism uses SERVER_EMAIL for the From:
address, which defaults to root@localhost and can cause problems in the
email delivery.

Use the same address than DEFAULT_FROM_EMAIL by default.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
---
 patchwork/settings/base.py               | 1 +
 patchwork/settings/production.example.py | 1 +
 2 files changed, 2 insertions(+)
diff mbox

Patch

diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py
index 89d30c9..ab03814 100644
--- a/patchwork/settings/base.py
+++ b/patchwork/settings/base.py
@@ -67,6 +67,7 @@  TEMPLATE_DIRS = (
 # Email
 
 DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@patchwork.example.com>'
+SERVER_EMAIL = DEFAULT_FROM_EMAIL
 
 #
 # Auth settings
diff --git a/patchwork/settings/production.example.py b/patchwork/settings/production.example.py
index 7af79a7..9cf6712 100644
--- a/patchwork/settings/production.example.py
+++ b/patchwork/settings/production.example.py
@@ -34,6 +34,7 @@  ADMINS = (
 )
 
 DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@patchwork.example.com>'
+SERVER_EMAIL = DEFAULT_FROM_EMAIL
 NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL
 
 # Database