mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
Send upload_id to Template Preview for logging
This means we can include the anonymous ID for the file in the log we have about Type3 fonts [1]. Currently, we have no way of tracing manually uploaded files with this potential defect. [1]: https://github.com/alphagov/notifications-template-preview/pull/557
This commit is contained in:
@@ -94,11 +94,12 @@ def get_page_count_for_letter(template, values=None):
|
||||
return page_count
|
||||
|
||||
|
||||
def sanitise_letter(pdf_file, *, allow_international_letters):
|
||||
def sanitise_letter(pdf_file, *, upload_id, allow_international_letters):
|
||||
return requests.post(
|
||||
'{}/precompiled/sanitise?allow_international_letters={}'.format(
|
||||
'{}/precompiled/sanitise?allow_international_letters={}&upload_id={}'.format(
|
||||
current_app.config['TEMPLATE_PREVIEW_API_HOST'],
|
||||
'true' if allow_international_letters else 'false',
|
||||
upload_id,
|
||||
),
|
||||
data=pdf_file,
|
||||
headers={'Authorization': 'Token {}'.format(current_app.config['TEMPLATE_PREVIEW_API_KEY'])}
|
||||
|
||||
Reference in New Issue
Block a user