Address rules by country: switching the feature off changes nothing on Your details #635
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#635
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, following the Address rules by country switch from the policy to the address form.Related to #147.
Checked again on 2026-10-01 against
mainat0a5cad587: still present.The feature's description ends "Switched off, every address is free-form with neutral labels." The address form never asks the policy, so the switch has no effect on the one page that shows addresses.
core/postal.py:114-129(label_for,warnings_for): the policy is consulted only when apersonis passed.core/postal.py:235(PostalAddressForm._post_clean):warnings_for(self.instance), no person.core/postal.py:237-242(labels_for_country):label_for(part, country), no person.core/postal.py:288-302(formset_for): no parameter for the person; called fromaccounts/views.py:89.plugins/postal_rules/__init__.py:85-91: the description.tests/test_postal_rules.py:216-225(test_off_is_the_same_path_a_country_with_no_rules_takes): replacesrules_applyand calls the helpers directly withperson=user, so it passes without the page honouring the switch.postal.rules_applyreplaced by a function that records its calls and returnsFalse: a boundPostalAddressFormfor a US address returned{'postcode': 'ZIP code', 'municipality': 'Town or city', 'region': 'State'}fromlabels_for_country(), two notes incountry_notes, andrules_applywas consulted 0 times. The only caller that passes a person is the candidate-file importer (resume/candidate.py:911).core/postal.py:132-138(render), which also honours the switch, has no caller insrc.formset_forandPostalAddressFormthe person (throughform_kwargs), pass it tolabel_forandwarnings_forinlabels_for_countryand_post_clean, and passrequest.userfromaccounts/views.py. Replace the test with one that goes through the form. #306 is reworking this form; the check belongs in whatever it leaves.Done when
tests/test_postal_rules.pyposts the address formset on Your details with the feature switched off for the person and asserts neutral labels and nocountry_notes; it fails today.