mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-11 21:48:20 +02:00
Use waffle flag
Genius suggestion by abbrodrick!
This commit is contained in:
parent
d36435a981
commit
d8265dd423
6 changed files with 5 additions and 117 deletions
|
@ -8,7 +8,7 @@ from django.template.loader import get_template
|
|||
from email.mime.application import MIMEApplication
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from waffle import switch_is_active
|
||||
from waffle import flag_is_active
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -36,7 +36,8 @@ def send_templated_email(
|
|||
|
||||
Raises EmailSendingError if SES client could not be accessed
|
||||
"""
|
||||
if switch_is_active("disable_email_sending") and not settings.IS_PRODUCTION:
|
||||
|
||||
if flag_is_active(None, "disable_email_sending") and not settings.IS_PRODUCTION:
|
||||
message = "Could not send email. Email sending is disabled due to switch 'disable_email_sending'."
|
||||
raise EmailSendingError(message)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue