Move letter length check to utils repo so template-preview can use it, too

Update requirements
This commit is contained in:
Pea Tyczynska
2019-10-09 14:56:18 +01:00
parent c524b0bbf5
commit 2ed1e382b4
8 changed files with 20 additions and 85 deletions

View File

@@ -6,7 +6,9 @@ from flask import abort, flash, redirect, render_template, request, url_for
from flask_login import current_user
from markupsafe import Markup
from notifications_python_client.errors import HTTPError
from notifications_utils import LETTER_MAX_PAGE_COUNT
from notifications_utils.formatters import nl2br
from notifications_utils.pdf import is_letter_too_long
from notifications_utils.recipients import first_column_headings
from app import (
@@ -31,10 +33,8 @@ from app.models.service import Service
from app.models.template_list import TemplateList, TemplateLists
from app.template_previews import TemplatePreview, get_page_count_for_letter
from app.utils import (
LETTER_MAX_PAGES,
email_or_sms_not_enabled,
get_template,
is_letter_too_long,
should_skip_template_page,
user_has_permissions,
user_is_platform_admin,
@@ -77,7 +77,7 @@ def view_template(service_id, template_id):
template_postage=template["postage"],
user_has_template_permission=user_has_template_permission,
letter_too_long=is_letter_too_long(get_page_count_for_letter(template)),
letter_max_pages=LETTER_MAX_PAGES,
letter_max_pages=LETTER_MAX_PAGE_COUNT,
)