Make it possible to preview a broadcast template

At the moment this won’t look like much, but it will let us do an
end-to-end run of adding a broadcast template.

At the moment all you can do with a broadcast template is edit it, so
there’s no ‘Send’ link on the page.
This commit is contained in:
Chris Hill-Scott
2020-07-01 17:43:30 +01:00
parent 154d4bdb85
commit 724e8d1838
6 changed files with 73 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ from notifications_utils.postal_address import PostalAddress
from notifications_utils.recipients import RecipientCSV
from notifications_utils.take import Take
from notifications_utils.template import (
BroadcastPreviewTemplate,
EmailPreviewTemplate,
LetterImageTemplate,
LetterPreviewTemplate,
@@ -437,6 +438,10 @@ def get_template(
admin_base_url=current_app.config['ADMIN_BASE_URL'],
redact_missing_personalisation=redact_missing_personalisation,
)
if 'broadcast' == template['template_type']:
return BroadcastPreviewTemplate(
template,
)
def get_current_financial_year():