Europass import (old formats): UK and EL are stored as the country, which Postulo does not know #639
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#639
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, reading the three Europass readers side by side and running the old ones on an address with each code.The two SkillsPassport readers take an address's country as the first two characters of whatever the file's
Codeholds, and the import stores it inPostalAddress.country, which is an ISO 3166-1 alpha-2 code. Cedefop's Europass did not write ISO for two countries: it used the European Union's own codes,UKfor the United Kingdom andELfor Greece. Neither is in Postulo's country table, so a British or Greek address arrives with a country Postulo cannot name, flag, check or show in its own form.Checked again on 2026-10-01 against
mainat0a5cad587: still present, atplugins/europass/reader.py:122-136.plugins/europass/reader.py:168-177(_country_code) and:180-182(_json_country_code):.strip().upper()[:2], used at:484and:780.resume/importing.py:104(_write_address):country=(parts.get("country") or "")[:2], with no check against the country table.plugins/europass/candidate.py:292-300(_country), which takes a code only when it is exactly two ASCII letters, and whose docstring gives the reason: "cuttingPRTto two letters would make it Puerto Rico".<Country><Code>UK</Code><Label>United Kingdom</Label></Country>. Postulo's own JSON fixture writes a country this way (tests/data/europass.json:56).'country': 'UK'and the import saves the row with it.phones.country_name("UK")returnsUK, so the address reads "…, London, UK" where every other one has the country's name;flag_url("UK")is empty;postal_rules.rule_for("UK")is the empty rule, so the parts get neutral labels and no notes.UKoption, so the row opens with no country chosen. The next save of that page stores an empty country without saying so.EL. A file that writes a three-letter code is cut to another country:PRTis stored asPR, which the table knows as Puerto Rico.candidate._countryto a helper all three share; in it, mapUKtoGBandELtoGR, accept a code only when it is exactly two ASCII letters, and return an empty string otherwise (the country's label is still inlocation). Checking the code against the country table inimporting._write_addressbelongs with the review's issue about import values stored without the profile forms' checks.Done when
tests/test_europass.pyreads an XML file and a JSON file whose address has the codeUK, and findsGBinrecord.person["address"]["country"]; the same forELandGR. It fails today.tests/test_europass.pyreads an address whose code isPRTand finds an empty country, notPR.