From 4798258e624d5b859f30f6867a3e721527364955 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Sat, 24 Jun 2017 17:18:49 +0100 Subject: [PATCH] Add `redact_missing` argument to `get_template` Adds an interface to use: https://github.com/alphagov/notifications-utils/pull/171 --- app/utils.py | 10 +++++++--- requirements.txt | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/utils.py b/app/utils.py index 5f6afc925..5f4a01c84 100644 --- a/app/utils.py +++ b/app/utils.py @@ -267,6 +267,7 @@ def get_template( expand_emails=False, letter_preview_url=None, page_count=1, + redact_missing_personalisation=False, ): if 'email' == template['template_type']: return EmailPreviewTemplate( @@ -274,14 +275,16 @@ def get_template( from_name=service['name'], from_address='{}@notifications.service.gov.uk'.format(service['email_from']), expanded=expand_emails, - show_recipient=show_recipient + show_recipient=show_recipient, + redact_missing_personalisation=redact_missing_personalisation, ) if 'sms' == template['template_type']: return SMSPreviewTemplate( template, prefix=service['name'], sender=(service['sms_sender'] not in {'GOVUK', None}), - show_recipient=show_recipient + show_recipient=show_recipient, + redact_missing_personalisation=redact_missing_personalisation, ) if 'letter' == template['template_type']: if letter_preview_url: @@ -294,7 +297,8 @@ def get_template( return LetterPreviewTemplate( template, contact_block=service['letter_contact_block'], - admin_base_url=current_app.config['ADMIN_BASE_URL'] + admin_base_url=current_app.config['ADMIN_BASE_URL'], + redact_missing_personalisation=redact_missing_personalisation, ) diff --git a/requirements.txt b/requirements.txt index b7c16d11c..5ea04f2be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,4 +28,4 @@ notifications-python-client>=3.1,<3.2 awscli>=1.11,<1.12 awscli-cwlogs>=1.4,<1.5 -git+https://github.com/alphagov/notifications-utils.git@17.3.2#egg=notifications-utils==17.3.2 +git+https://github.com/alphagov/notifications-utils.git@17.5.0#egg=notifications-utils==17.5.0