Code

Opened 4 years ago

Closed 4 years ago

#14864 closed (fixed)

ROCIFField in localflavor has a bad regex

Reported by: idangazit Owned by: idangazit
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: UI/UX:

Description

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 idangazit 4 years ago.

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by idangazit

comment:1 Changed 4 years ago by idangazit

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 4 years ago by idangazit

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 4 years ago by Alex

  • Resolution set to fixed
  • Status changed from assigned to closed

(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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.