From 433e8fe921a3af179bbb841797adaf5ce8ed2962 Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Tue, 1 Nov 2016 14:30:33 -0400 Subject: [PATCH] Email --- settings.py | 4 ++-- snipts/views.py | 5 ++++- teams/views.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/settings.py b/settings.py index 9c0563b..1ad042d 100644 --- a/settings.py +++ b/settings.py @@ -37,7 +37,7 @@ AUTH_PROFILE_MODULE = 'accounts.UserProfile' AUTHENTICATION_BACKENDS = ('utils.backends.EmailOrUsernameModelBackend',) BASE_PATH = os.path.dirname(__file__) DEBUG = True if 'DEBUG' in os.environ else False -DEFAULT_FROM_EMAIL = 'support@snipt.net' +DEFAULT_FROM_EMAIL = os.environ.get('POSTMARK_INBOUND_ADDRESS', 'snipt@localhost') EMAIL_BACKEND = 'postmark.django_backend.EmailBackend' HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' INTERNAL_IPS = ('127.0.0.1',) @@ -65,7 +65,7 @@ ROOT_URLCONF = 'urls' SECRET_KEY = os.environ.get('SECRET_KEY', 'changeme') SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') SEND_BROKEN_LINK_EMAILS = False -SERVER_EMAIL = 'support@snipt.net' +SERVER_EMAIL = os.environ.get('POSTMARK_INBOUND_ADDRESS', 'snipt@localhost') SESSION_COOKIE_AGE = 15801100 SESSION_COOKIE_SECURE = True if 'USE_SSL' in os.environ else False SITE_ID = 1 diff --git a/snipts/views.py b/snipts/views.py index 6ce9d8c..c65bb8e 100644 --- a/snipts/views.py +++ b/snipts/views.py @@ -18,6 +18,9 @@ from snipts.models import Favorite, Snipt, SniptSecureView from taggit.models import Tag from teams.models import Team +import os + + RESULTS_PER_PAGE = getattr(settings, 'HAYSTACK_SEARCH_RESULTS_PER_PAGE', 20) @@ -99,7 +102,7 @@ def report_spam(request, snipt_id): User: https://snipt.net/admin/auth/user/{}/delete/ Reporter: https://snipt.net/{}/ """.format(snipt.id, snipt.user.id, request.user.username), - 'support@snipt.net', + os.environ.get('POSTMARK_INBOUND_ADDRESS', 'snipt@localhost'), ['nick@snipt.net'], fail_silently=False) diff --git a/teams/views.py b/teams/views.py index 31ab3cc..81c4554 100644 --- a/teams/views.py +++ b/teams/views.py @@ -42,7 +42,7 @@ def for_teams_complete(request): Team: https://snipt.net/{} Email: {} """.format(team.slug, team.email), - 'support@snipt.net', + os.environ.get('POSTMARK_INBOUND_ADDRESS', 'snipt@localhost'), ['nick@snipt.net'], fail_silently=False)