Skip to content

Commit 25a376c

Browse files
authored
Merge pull request #1627 from KentShikama/kent-multnomah-forms
Ensure Multnomah uses old forms and remove old forms otherwise
2 parents f9529cf + e9fdf5b commit 25a376c

File tree

3 files changed

+13
-350
lines changed

3 files changed

+13
-350
lines changed

src/backend/expungeservice/form_filling.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from expungeservice.models.charge_types.reduced_to_violation import ReducedToViolation
1919
from expungeservice.models.charge_types.violation import Violation
2020
from expungeservice.models.record_summary import RecordSummary
21-
from expungeservice.old_form_filling import FormFilling as OldFormFilling
2221
from expungeservice.pdf.markdown_to_pdf import MarkdownToPDF
2322

2423
from pdfrw import PdfReader, PdfWriter, PdfDict, PdfObject
@@ -116,11 +115,6 @@ def build_zip(record_summary: RecordSummary, user_information: Dict[str, str]) -
116115
trailer.Root.AcroForm = pdf.Root.AcroForm
117116
writer.write(file_path, trailer=trailer)
118117
zipfile.write(file_path, file_name)
119-
120-
# TODO: Remove
121-
old_zip_path, old_zip_name = OldFormFilling.build_zip(record_summary, user_information)
122-
zipfile.write(old_zip_path, old_zip_name)
123-
124118
zipfile.close()
125119
return zip_path, zip_name
126120

@@ -363,16 +357,21 @@ def _build_pdf_path(location: str, convictions: List[Charge]) -> str:
363357
return path.join(Path(__file__).parent, "files", "oregon_with_conviction_order.pdf")
364358
else:
365359
return path.join(Path(__file__).parent, "files", "oregon_with_arrest_order.pdf")
360+
elif location == "multnomah":
361+
if convictions:
362+
return path.join(Path(__file__).parent, "files", "multnomah_conviction.pdf")
363+
else:
364+
return path.join(Path(__file__).parent, "files", "multnomah_arrest.pdf")
366365
else:
367366
return path.join(Path(__file__).parent, "files", "oregon.pdf")
368367

369368
@staticmethod
370369
def _build_base_file_name(location: str, convictions: List[Charge]) -> str:
371-
# Douglas and Umatilla counties explicitly want the "Order" part of the old forms too.
372-
if location in ["douglas", "umatilla"]:
373-
if convictions:
374-
return path.join(Path(__file__).parent, "files", f"{location}_with_conviction_order.pdf")
375-
else:
376-
return path.join(Path(__file__).parent, "files", f"{location}_with_arrest_order.pdf")
370+
# Douglas and Umatilla counties explicitly want the "Order" part of the old forms too.
371+
if location in ["douglas", "umatilla"]:
372+
if convictions:
373+
return path.join(Path(__file__).parent, "files", f"{location}_with_conviction_order.pdf")
377374
else:
378-
return path.join(Path(__file__).parent, "files", f"{location}.pdf")
375+
return path.join(Path(__file__).parent, "files", f"{location}_with_arrest_order.pdf")
376+
else:
377+
return path.join(Path(__file__).parent, "files", f"{location}.pdf")

src/backend/expungeservice/old_form_filling.py

Lines changed: 0 additions & 336 deletions
This file was deleted.

src/backend/tests/test_form_filling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ def test_normal_conviction_uses_multnomah_conviction_form():
3030
with ZipFile(zip_path, "r") as zip_ref:
3131
zip_ref.extractall(temp_dir)
3232
for _root, _dir, files in os.walk(temp_dir):
33-
assert len(files) == 3
33+
assert len(files) == 2

0 commit comments

Comments
 (0)