Only show overlay when content is outside the printable area

The overlay was showing for any invalid pdf - we only want to show the
overlay for invalid pdf files where there is content outside the
printable area.
This commit is contained in:
Katie Smith
2019-10-21 11:10:27 +01:00
parent 3b3f74bbf0
commit b0ffca2774
2 changed files with 50 additions and 2 deletions

View File

@@ -181,7 +181,7 @@ def view_letter_upload_as_preview(service_id, file_id):
page = request.args.get('page')
if metadata['status'] == 'invalid':
if metadata.get('message') == 'content-outside-printable-area':
return TemplatePreview.from_invalid_pdf_file(pdf_file, page)
else:
return TemplatePreview.from_valid_pdf_file(pdf_file, page)