Refactor to use is_precompiled_letter in letters/utils.py

This commit is contained in:
Ken Tsang
2018-03-06 13:04:57 +00:00
parent bca858f4a8
commit 28136734e4
3 changed files with 10 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ from flask import current_app
from notifications_utils.s3 import s3upload
from app.models import LETTER_TYPE
from app.variables import Retention
@@ -79,4 +80,8 @@ def get_letter_pdf(notification):
def is_precompiled_letter(template):
return template.hidden and template.name == current_app.config['PRECOMPILED_TEMPLATE_NAME']
return (
template.template_type == LETTER_TYPE and
template.hidden and
template.name == current_app.config['PRECOMPILED_TEMPLATE_NAME']
)