From c189f09687b3fbd016896b8abd67365d2ce1feaa Mon Sep 17 00:00:00 2001 From: Alexey Bezhan Date: Mon, 9 Apr 2018 16:27:56 +0100 Subject: [PATCH] Update template content values from notification personalisation We need to set template_with_content placeholder values with an updated personalisation dictionary after processing the document uploads in order to avoid returning base64 file data instead of the document URLs in the response contents. --- app/v2/notifications/post_notifications.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/v2/notifications/post_notifications.py b/app/v2/notifications/post_notifications.py index 388a78168..178893218 100644 --- a/app/v2/notifications/post_notifications.py +++ b/app/v2/notifications/post_notifications.py @@ -138,7 +138,7 @@ def post_notification(notification_type): reply_to_text=reply_to ) else: - notification, personalisation = process_sms_or_email_notification( + notification = process_sms_or_email_notification( form=form, notification_type=notification_type, api_key=api_user, @@ -147,7 +147,7 @@ def post_notification(notification_type): reply_to_text=reply_to ) - template_with_content.values = personalisation + template_with_content.values = notification.personalisation if notification_type == SMS_TYPE: create_resp_partial = functools.partial( @@ -216,7 +216,7 @@ def process_sms_or_email_notification(*, form, notification_type, api_key, templ else: current_app.logger.debug("POST simulated notification for id: {}".format(notification.id)) - return notification, personalisation + return notification def process_document_uploads(personalisation_data, service, simulated=False):