Opened 8 years ago

Closed 8 years ago

#14864 closed (fixed)

ROCIFField in localflavor has a bad regex

Reported by: Idan Gazit Owned by: Idan Gazit
Component: contrib.localflavor Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Valid values are 2-10 digit numbers, optionally prefixed by the uppercase characters 'RO'.

On L33, there is logic for removing the prefix if it exists, but the regex in __init__ does not account for the prefix, leading to ValidationErrors when super.clean() is called.

Attachments (1)

14864.diff (544 bytes) - added by Idan Gazit 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Idan Gazit

Attachment: 14864.diff added

comment:1 Changed 8 years ago by Idan Gazit

Status: newassigned

comment:2 Changed 8 years ago by Idan Gazit

Triage Stage: UnreviewedAccepted

comment:3 Changed 8 years ago by Alex Gaynor

Resolution: fixed
Status: assignedclosed

(In [14951]) Fixed #14864, #14864 -- ROCIFField didn't accept values starting with RO, as it was supposed to, and ROCNPField, ROIBANField, and ROPhoneNumberField didn't handle all EMPTY_VALUES correctly. Also converted Romanian localflavor doctests to unittests. We have always been at war with doctests. Thanks to Idan Gazit.

Fixing RO localflavor clean() #14864

Note: See TracTickets for help on using tickets.
Back to Top