Skip to content

Fix ALIndividual.address_block() to include both name and address - #1130

Draft
nonprofittechy wants to merge 2 commits into
mainfrom
fix/name-and-address-block
Draft

nonprofittechy wants to merge 2 commits into
mainfrom
fix/name-and-address-block

Conversation

@nonprofittechy

Copy link
Copy Markdown
Member

ALIndividual.address_block() is intended to return a person's name followed by their mailing address. It currently loses one component in each rendering context:

  • In DOCX, it returns self.address.block(...) directly, omitting the name.
  • Outside DOCX, Python parses the conditional expression as name if is_individual else other_name + address. For an ALIndividual, the true branch returns only the name, omitting the address.

Compute the name and address separately, then join them with the appropriate Word line break or Docassemble [NEWLINE] marker. Continue forwarding language/international/country options and the ALAddress-specific bare and show_impounded options. person.address.block() remains the address-only API. The docstring now distinguishes the two methods.

For Alex Rivera at 123 Main Street, the intended result in both formats is:

Alex Rivera
123 Main Street
Boston, MA 02108

Validation

  • Focused tests on a clean checkout of upstream main: 2 passed, 2 subtests passed. They cover both rendering contexts, real name/address objects, address-only behavior, impounded-address hiding/override, and plain Docassemble Address option compatibility.
  • Black and git diff --check pass.
  • This exact runtime fix was installed on localhost for Weaver PR #1203. Generated PDF and DOCX interviews reached download; actual downloaded artifacts contain both components. A review edit updated both output formats.
  • Unlisted evidence gist: exact templates, generated YAML, downloaded PDF/DOCX files, checksums, readable extracts, and a verifier that passed locally.

The full runtime test file previously had an unrelated test_address_required failure (state_or_province_label) also reproduced against an unchanged sibling checkout in this environment; this does not claim the entire upstream suite passes. Confidentiality has focused test coverage but not a full browser matrix.

Coordination

Draft for runtime review and release coordination. This is the upstream implementation corresponding to the companion patch recorded in Weaver PR #1203; authors should not need to apply that patch manually once a release contains the fix. Weaver's new users1_name_and_address_block alias depends on the corrected behavior. Its existing users1_address_block alias continues to use the unchanged address-only method.

Related: SuffolkLITLab/docassemble-ALWeaver#670. No release version is claimed yet.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused fix preserves address delegation and option compatibility, with regression coverage and no unresolved blocking findings.

No open issues 🎉

What changed in this PR

Fixes ALIndividual.address_block() so mailing blocks include both the full name and address in DOCX and non-DOCX output, while preserving the address-only API.

Changes:

  • Combines name and address with format-specific line breaks.
  • Preserves formatting options and address confidentiality handling.
  • Clarifies the docstring and adds regression tests for rendering, confidentiality, and plain Address compatibility.
File Description
docassemble/​AssemblyLine/​test_al_general.py Adds focused mailing-block regression tests.
docassemble/​AssemblyLine/​al_general.py Fixes name-and-address composition and documents the API distinction.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants