Use waffle flag

Genius suggestion by abbrodrick!
This commit is contained in:
zandercymatics 2024-05-31 13:18:05 -06:00
parent d36435a981
commit d8265dd423
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
6 changed files with 5 additions and 117 deletions

View file

@ -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)