handle invalid upload errors correctly

previously it assumed that invalid_pages would always exist, however it
might be `None` if the error isn't on a specific page. Errors on
specific pages include a page not being A4 or content being outside the
boundary. Errors not on specific pages include the file not being a pdf,
or containing too many pages
This commit is contained in:
Leo Hemsted
2020-01-27 15:07:40 +00:00
parent da2bc29b40
commit 4e1fcfbff1
2 changed files with 5 additions and 3 deletions

View File

@@ -458,7 +458,7 @@ def test_get_letter_validation_error_for_unknown_error():
),
(
'letter-too-long',
[2],
None,
'Your letter is too long',
(
'Letters must be 10 pages or less. '
@@ -471,7 +471,7 @@ def test_get_letter_validation_error_for_unknown_error():
),
(
'unable-to-read-the-file',
[2],
None,
'Theres a problem with your file',
(
'Notify cannot read this PDF.'