Cleaning up a lot of things, getting Enums used everywhere.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-02-28 12:40:52 -05:00
parent 0368307802
commit 820ee5a942
30 changed files with 209 additions and 180 deletions

View File

@@ -41,11 +41,11 @@ def url_with_token(data, url, config, base_url=None):
def get_template_instance(template, values):
from app.models import EMAIL_TYPE, SMS_TYPE
from app.models import TemplateType
return {
SMS_TYPE: SMSMessageTemplate,
EMAIL_TYPE: HTMLEmailTemplate,
TemplateType.SMS: SMSMessageTemplate,
TemplateType.EMAIL: HTMLEmailTemplate,
}[
template["template_type"]
](template, values)
@@ -80,10 +80,10 @@ def get_month_from_utc_column(column):
def get_public_notify_type_text(notify_type, plural=False):
from app.models import SMS_TYPE, UPLOAD_DOCUMENT
from app.models import NotificationType, UPLOAD_DOCUMENT
notify_type_text = notify_type
if notify_type == SMS_TYPE:
if notify_type == NotificationType.SMS:
notify_type_text = "text message"
elif notify_type == UPLOAD_DOCUMENT:
notify_type_text = "document"