mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-04 05:31:44 -04:00
Updated copy on the page.
Added unit tests. Added error when file is too big.
This commit is contained in:
@@ -280,6 +280,14 @@ def letter_validation_preview(from_platform_admin):
|
||||
), 400
|
||||
|
||||
try:
|
||||
if len(pdf_file.read()) > (2 * 1024 * 1024):
|
||||
return render_template(
|
||||
view_location,
|
||||
form=form,
|
||||
message="File must be less than 2MB",
|
||||
pages=pages, result=result
|
||||
), 400
|
||||
pdf_file.seek(0)
|
||||
response = validate_letter(pdf_file)
|
||||
response.raise_for_status()
|
||||
if response.status_code == 200:
|
||||
|
||||
Reference in New Issue
Block a user