UKPostcodeField made more forgiving of input format
|Reported by:||scott@…||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
The UKPostcodeField in django.contrib.localflavor.uk does a good job of checking a UK postcode is valid. However, it requires the letters to be uppercase and a space between the two parts. I think that's a bit too strict.
Here is a version that is more forgiving. It uppercases the string and inserts the space in the correct place before validation.
Patch and tests attached.
Change History (5)
Changed 9 years ago by scott@…
comment:1 Changed 8 years ago by Simon G <dev@…>
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Ready for checkin
comment:2 Changed 8 years ago by jacob
- Patch needs improvement set
- Triage Stage changed from Ready for checkin to Accepted