Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion legal-api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "legal-api"
version = "3.1.78"
version = "3.1.79"
description = ""
authors = [
{name = "thor",email = "1042854+thorwolpert@users.noreply.github.com"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,10 @@ def _validate_court_order_documents(court_order_path, court_order, is_file_and_d
msg.append({"error": _("Court Order is required (in orderDetails/fileKey/files)."), "path": court_order_path})

if file_key:
msg.extend(validate_pdf(file_key, f"{court_order_path}/fileKey", max_file_size=MAX_COURT_ORDER_FILE_SIZE))
msg.extend(validate_pdf(file_key,
f"{court_order_path}/fileKey",
verify_paper_size=False,
max_file_size=MAX_COURT_ORDER_FILE_SIZE))
elif files:
msg.extend(_validate_court_order_documents_list(f"{court_order_path}/files", files, existing_file_keys))

Expand All @@ -631,6 +634,7 @@ def _validate_court_order_documents_list(files_path, files, existing_file_keys):

msg.extend(validate_pdf(file.get("fileKey"),
f"{files_path}/{file_index}/fileKey",
verify_paper_size=False,
max_file_size=MAX_COURT_ORDER_FILE_SIZE))

if court_order_document_count == 0: # if only supporting documents and no court order documents were found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,8 @@ def test_court_order_invalid_effect_of_order(session, monkeypatch, is_migrated,
'test_name, expected_code, expected_msg',
[
('SUCCESS', None, None),
('FAIL_INVALID_FILE_KEY', HTTPStatus.BAD_REQUEST, [{'error': 'Invalid file.', 'path': file_key_path}]),
('FAIL_INVALID_FILE_KEY_SIZE', HTTPStatus.BAD_REQUEST, [{
'error': 'Document must be set to fit onto 8.5” x 11” letter-size paper.',
'path': file_key_path}])
('SUCCESS_NON_LETTER_PAGE_SIZE', None, None),
('FAIL_INVALID_FILE_KEY', HTTPStatus.BAD_REQUEST, [{'error': 'Invalid file.', 'path': file_key_path}])
])
def test_court_order_file(session, monkeypatch, test_name, expected_code, expected_msg, is_file_key):
"""Assert valid court order."""
Expand All @@ -158,7 +156,8 @@ def test_court_order_file(session, monkeypatch, test_name, expected_code, expect
if is_file_key:
if test_name == 'SUCCESS':
filing['filing']['courtOrder']['fileKey'] = _upload_file(letter, invalid=False)
elif test_name == 'FAIL_INVALID_FILE_KEY_SIZE':
elif test_name == 'SUCCESS_NON_LETTER_PAGE_SIZE':
# court order documents are accepted at any page size (legal size is common for court documents)
filing['filing']['courtOrder']['fileKey'] = _upload_file(letter, invalid=True)
else:
files = []
Expand All @@ -171,7 +170,7 @@ def test_court_order_file(session, monkeypatch, test_name, expected_code, expect
else:
files.append({
"fileName": "test_file.pdf",
"fileKey": _upload_file(letter, invalid=(test_name == 'FAIL_INVALID_FILE_KEY_SIZE')),
"fileKey": _upload_file(letter, invalid=(test_name == 'SUCCESS_NON_LETTER_PAGE_SIZE')),
"documentType": "court_order"
})
del filing['filing']['courtOrder']['fileKey']
Expand Down