mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Remove letters-related code (#175)
This deletes a big ol' chunk of code related to letters. It's not everything—there are still a few things that might be tied to sms/email—but it's the the heart of letters function. SMS and email function should be untouched by this. Areas affected: - Things obviously about letters - PDF tasks, used for precompiling letters - Virus scanning, used for those PDFs - FTP, used to send letters to the printer - Postage stuff
This commit is contained in:
13
app/utils.py
13
app/utils.py
@@ -2,11 +2,7 @@ from datetime import datetime, timedelta
|
||||
from os import getenv
|
||||
|
||||
from flask import url_for
|
||||
from notifications_utils.template import (
|
||||
HTMLEmailTemplate,
|
||||
LetterPrintTemplate,
|
||||
SMSMessageTemplate,
|
||||
)
|
||||
from notifications_utils.template import HTMLEmailTemplate, SMSMessageTemplate
|
||||
from notifications_utils.timezones import convert_local_timezone_to_utc
|
||||
from sqlalchemy import func
|
||||
|
||||
@@ -46,11 +42,10 @@ def url_with_token(data, url, config, base_url=None):
|
||||
|
||||
|
||||
def get_template_instance(template, values):
|
||||
from app.models import EMAIL_TYPE, LETTER_TYPE, SMS_TYPE
|
||||
from app.models import EMAIL_TYPE, SMS_TYPE
|
||||
return {
|
||||
SMS_TYPE: SMSMessageTemplate,
|
||||
EMAIL_TYPE: HTMLEmailTemplate,
|
||||
LETTER_TYPE: LetterPrintTemplate,
|
||||
}[template['template_type']](template, values)
|
||||
|
||||
|
||||
@@ -86,14 +81,12 @@ def get_local_month_from_utc_column(column):
|
||||
|
||||
|
||||
def get_public_notify_type_text(notify_type, plural=False):
|
||||
from app.models import PRECOMPILED_LETTER, SMS_TYPE, UPLOAD_DOCUMENT
|
||||
from app.models import SMS_TYPE, UPLOAD_DOCUMENT
|
||||
notify_type_text = notify_type
|
||||
if notify_type == SMS_TYPE:
|
||||
notify_type_text = 'text message'
|
||||
elif notify_type == UPLOAD_DOCUMENT:
|
||||
notify_type_text = 'document'
|
||||
elif notify_type == PRECOMPILED_LETTER:
|
||||
notify_type_text = 'precompiled letter'
|
||||
|
||||
return '{}{}'.format(notify_type_text, 's' if plural else '')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user