WIP refactor letter preview function

This commit is contained in:
Ken Tsang
2018-03-01 13:26:32 +00:00
parent 42622d86e1
commit b34b0e2870

View File

@@ -95,21 +95,21 @@ def view_letter_notification_as_preview(service_id, notification_id, filetype):
if filetype not in ('pdf', 'png'): if filetype not in ('pdf', 'png'):
abort(404) abort(404)
notification = notification_api_client.get_notification(service_id, notification_id) # notification = notification_api_client.get_notification(service_id, notification_id)
notification['template'].update({'reply_to_text': notification['reply_to_text']}) # notification['template'].update({'reply_to_text': notification['reply_to_text']})
template = get_template( # template = get_template(
notification['template'], # notification['template'],
current_service, # current_service,
letter_preview_url=url_for( # letter_preview_url=url_for(
'.view_letter_notification_as_preview', # '.view_letter_notification_as_preview',
service_id=service_id, # service_id=service_id,
notification_id=notification_id, # notification_id=notification_id,
filetype='png', # filetype='png',
), # ),
) # )
template.values = notification['personalisation'] # template.values = notification['personalisation']
try: try:
preview = notification_api_client.get_notification_letter_preview( preview = notification_api_client.get_notification_letter_preview(