mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
fix pdf download link trying to request a page count
It doesn't make sense to get a pdf for only one page - the template preview app just returns a 400 if you try. So we shouldn't try!
This commit is contained in:
@@ -266,7 +266,7 @@ def platform_admin_letter_validation_preview():
|
||||
if response.status_code == 200:
|
||||
pages, message, result = response.json()["pages"], response.json()["message"], response.json()["result"]
|
||||
except RequestException as error:
|
||||
if error.response.status_code == 400:
|
||||
if error.response and error.response.status_code == 400:
|
||||
message = "Something was wrong with the file you tried to upload. Please upload a valid PDF file."
|
||||
return render_template(
|
||||
'views/platform-admin/letter-validation-preview.html',
|
||||
|
||||
Reference in New Issue
Block a user