Address rules: the print order, render() and expects() are used by nothing, though the changelog announces them #643
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#643
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, searchingsrc, the templates,assets, the tests, the wiki and the sibling repositories for every caller of the address-rules functions.Related to #147.
The address-rules plugin says it knows "what order it prints" and keeps an
orderfor each of its 37 countries, but no page, document or export prints an address through it. Two functions, a wrapper and a table column are kept and tested for a feature that does not exist yet, and the changelog announces it. The code would also misprint the first time something used it.Checked again on 2026-10-01 against
mainat0a5cad587: still present;plugins/postal_rules/is unchanged andcore/postal.py:132-138still has no caller.plugins/postal_rules/__init__.py:151-170(render): called only bycore/postal.py:132-138and by four tests,tests/test_postal_rules.py:166-211.core/postal.py:132-138(render, the wrapper that honours the off switch): no caller anywhere, tests included.plugins/postal_rules/__init__.py:107-113(expects, "Read by the form to mark a field"): no caller anywhere, tests included. The form marks nothing.plugins/postal_rules/rules.py:59-60(Rule.order) and theorder=of every row: read only byrenderand by the table's self-check attests/test_postal_rules.py:251.core/postal.py:80-95(location_line): called only bytests/test_postal_addresses.py:117.plugins/postal_rules/__init__.pyand ofrules.py("what order it prints"), andCHANGELOG.md:942-944("what order the whole thing prints in"). Where an address is shown today (core/models.py:600-615,one_line) it is in the order it was entered.renderwould do if it were called:" ".join(joined.split())at:167collapses every run of white space, so a street typed on two lines (the form gives the street two rows on purpose,core/postal.py:184-190) prints as one: "1 High Street" and "Flat 2" came back as'1 High Street Flat 2'.region, so a region the person typed is left out. For five of those (AT, CH, DE, GB, PT) the same row gives the region a name incalls, so the form asks for a County or a Distrito that the print-out then drops. The notes on AT and DE say this is how post is addressed there; for a value somebody typed, that is a decision to take, not to inherit.plugins/postal_rules/__init__.py:127-128:if rule is None: return []cannot be true, becauserule_foralways returns aRule(rules.py:330-332).plugins/postal_rules/rules.py:56-58: the comment onRule.callsnames alabels.pythat does not exist; the words are inLABELSin__init__.py.postal.render(address, person=…)where an address is shown as lines, keep the street's own lines, and settle what happens to a typed region the country's order does not list (append it after the town, or say on the form that it is not printed).render(both),expects,location_line, theordercolumn and their tests, and correct the two docstrings and the changelog entry.rule is Nonebranch and correct thelabels.pycomment.Related to #308, under which a CV prints a town and a country and never the street, so a CV is not the caller this code is waiting for.
Done when
postal.render, with a test intests/test_postal_rules.pythat a two-line street stays two lines and a typed region is not lost without the form saying so;tests/test_postal_rules.pyasserts thatpostal_rulesexports norenderand noexpects, and the docstrings andCHANGELOG.mdno longer mention a print order.Landed on main with a green Forgejo CI run. Its entry in the CHANGELOG's Unreleased section ends in (#643).