mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 08:51:30 -05:00
Grab metadata when getting pdf letter preview from S3
Also use this metadata to decide whether preview pages need overlay or not. So far we have always added overlay when validation has failed. Now we will only show it when validation failed due to content being outside of printable area.
This commit is contained in:
@@ -4,7 +4,7 @@ from flask import jsonify, request, url_for, current_app, send_file
|
||||
|
||||
from app import api_user, authenticated_service
|
||||
from app.dao import notifications_dao
|
||||
from app.letters.utils import get_letter_pdf
|
||||
from app.letters.utils import get_letter_pdf_and_metadata
|
||||
from app.schema_validation import validate
|
||||
from app.v2.errors import BadRequestError, PDFNotReadyError
|
||||
from app.v2.notifications import v2_notification_blueprint
|
||||
@@ -48,7 +48,7 @@ def get_pdf_for_notification(notification_id):
|
||||
raise PDFNotReadyError()
|
||||
|
||||
try:
|
||||
pdf_data = get_letter_pdf(notification)
|
||||
pdf_data, metadata = get_letter_pdf_and_metadata(notification)
|
||||
except Exception:
|
||||
raise PDFNotReadyError()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user