Refactor is_precompiled_letter to model

This commit is contained in:
Ken Tsang
2018-03-07 15:42:59 +00:00
parent 28136734e4
commit 7011b90bd4
16 changed files with 126 additions and 62 deletions

View File

@@ -5,7 +5,6 @@ from flask import current_app
from notifications_utils.s3 import s3upload
from app.models import LETTER_TYPE
from app.variables import Retention
@@ -77,11 +76,3 @@ def get_letter_pdf(notification):
file_content = obj.get()["Body"].read()
return file_content
def is_precompiled_letter(template):
return (
template.template_type == LETTER_TYPE and
template.hidden and
template.name == current_app.config['PRECOMPILED_TEMPLATE_NAME']
)