Skip to content

Commit

Permalink
refactor: CMD-112 rename variables (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar authored Apr 1, 2024
1 parent 557abeb commit f805ee7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions common_apps/email_management/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from django.core.mail import send_mail
from django.conf import settings

PORTAL_SHOULD_SEND_CONF_EMAIL = settings.PORTAL_SHOULD_SEND_CONF_EMAIL
TEXT_CONFIRMATION_EMAIL = settings.PORTAL_CONF_EMAIL_TEXT
HTML_CONFIRMATION_EMAIL = settings.PORTAL_CONF_EMAIL_HTML
SHOULD_SEND_CONF_EMAIL = settings.PORTAL_SHOULD_SEND_CONF_EMAIL
CONF_EMAIL_TEXT = settings.PORTAL_CONF_EMAIL_TEXT
CONF_EMAIL_HTML = settings.PORTAL_CONF_EMAIL_HTML

logger = logging.getLogger(f"portal.{__name__}")

Expand All @@ -25,8 +25,8 @@ def replace_word_in_file(email_content):
modified_content = email_content.replace('{site_name}', f'{site_name}')
return modified_content

text_body = replace_word_in_file(TEXT_CONFIRMATION_EMAIL)
email_body = replace_word_in_file(HTML_CONFIRMATION_EMAIL)
text_body = replace_word_in_file(CONF_EMAIL_TEXT)
email_body = replace_word_in_file(CONF_EMAIL_HTML)

send_mail(
f"TACC Form Submission Received: {form_name}",
Expand All @@ -39,7 +39,7 @@ def replace_word_in_file(email_content):
def callback(form, cleaned_data, **kwargs):
logger.debug(f"received submission from {form.name}")
logger.debug(type(cleaned_data))
if ('email' in cleaned_data and PORTAL_SHOULD_SEND_CONF_EMAIL):
if ('email' in cleaned_data and SHOULD_SEND_CONF_EMAIL):
send_confirmation_email(form.name, cleaned_data)

class EmailManagementConfig(AppConfig):
Expand Down

0 comments on commit f805ee7

Please sign in to comment.