mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Cleaning up a lot of things, getting Enums used everywhere.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
10
app/utils.py
10
app/utils.py
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user