From 9ce45e6f56b645fdb440ebb3c22c950a5ec65dd1 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 24 Feb 2019 18:41:07 +0100 Subject: [PATCH] Set EMAIL_FROM_ADDRESS from env --- dal/settings.py | 2 ++ dal/views.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dal/settings.py b/dal/settings.py index 137c914..b1210b1 100644 --- a/dal/settings.py +++ b/dal/settings.py @@ -48,6 +48,8 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DEBUG = config('DEBUG', default=False, cast=bool) +EMAIL_FROM_ADDRESS = config('EMAIL_FROM_ADDRESS') + ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv()) INSTALLED_APPS = [ diff --git a/dal/views.py b/dal/views.py index f697c90..2ea6dfb 100644 --- a/dal/views.py +++ b/dal/views.py @@ -197,7 +197,7 @@ class ResetPassword(View): # getting epoch for the time now in UTC to spare us headache with timezones creationtime = int(datetime.utcnow().timestamp()) # Construct the data for the email - email_from = 'Userservice at ungleich <%s>' % config['EMAIL']['EMAILFROM'] + email_from = settings.EMAIL_FROM_ADDRESS to = ['%s <%s>' % (user, email)] subject = 'Password reset request for %s' % user link = self.build_reset_link(user, creationtime)