Skip to content

Accept lowercase prefixes in Spanish NIE validation - #547

Open
Aminark wants to merge 2 commits into
python-validators:masterfrom
Aminark:fix/nie-prefix-case
Open

Aminark wants to merge 2 commits into
python-validators:masterfrom
Aminark:fix/nie-prefix-case

Conversation

@Aminark

@Aminark Aminark commented Oct 25, 2026

Copy link
Copy Markdown

es_nie("x0095892m") returns a validation error even though the shared NIF/NIE helper already normalizes letter case. The prefix check rejects the value before it reaches that helper.

Normalize the prefix check too, so NIE handling is consistent with NIF and CIF. The added tests cover X/Y/Z prefixes through both es_nie and es_doi, including invalid checksums.

Validation on Python 3.12: 1,586 tests passed; Ruff, formatting, Pyright and Bandit passed.

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.

1 participant