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.
This commit is contained in:
Alexey Bezhan
2018-04-09 16:27:56 +01:00
parent b097a16a86
commit c189f09687

View File

@@ -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):