mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 01:04:00 -04:00
Moved the call to retrieve the pdf into the is_precompiled_letter block
as it did not need to be called for standard letters. Changed the tests to use the mock from get_notification_letter_preview instead of a generic NotificationApiClient.get. This will hopefully protect any subsequent changes or calls from not being tested in future.
This commit is contained in:
@@ -46,9 +46,8 @@ def view_notification(service_id, notification_id):
|
||||
notification = notification_api_client.get_notification(service_id, str(notification_id))
|
||||
notification['template'].update({'reply_to_text': notification['reply_to_text']})
|
||||
|
||||
file_contents = view_letter_notification_as_preview(service_id, notification_id, "pdf")
|
||||
|
||||
if notification['template']['is_precompiled_letter']:
|
||||
file_contents = view_letter_notification_as_preview(service_id, notification_id, "pdf")
|
||||
page_count = pdf_page_count(io.BytesIO(file_contents))
|
||||
else:
|
||||
page_count = get_page_count_for_letter(notification['template'])
|
||||
|
||||
Reference in New Issue
Block a user