Opened 10 years ago

Closed 6 years ago

#7463 closed New feature (invalid)

alternate phone regex for US flavor forms

Reported by: kevin@… Owned by: nobody
Component: contrib.localflavor Version: master
Severity: Normal Keywords: localflavor, forms, areacode, delimiter, localflavorsplit
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


A growing subset of US organizations are starting to allow a slash as an area code delimiter (xxx/xxx-xxxx). Modulo tests by the core Django team, this patch enables that.

Attachments (3) (960 bytes) - added by kevin@… 10 years ago.
patch: allow forward slash as areacode delimiter
7463.diff (1.5 KB) - added by Mark Lavin 6 years ago.
Updated patch with tests.
7463-failingtests.diff (1.7 KB) - added by Karen Tracey 6 years ago.

Download all attachments as: .zip

Change History (11)

Changed 10 years ago by kevin@…

Attachment: added

patch: allow forward slash as areacode delimiter

comment:1 Changed 10 years ago by Eric Holscher

milestone: post-1.0
Triage Stage: UnreviewedAccepted

comment:2 Changed 9 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:3 Changed 7 years ago by Gabriel Hurley

Component: Contrib appscontrib.localflavor

comment:4 Changed 7 years ago by Luke Plant

Severity: Normal
Type: New feature

comment:5 Changed 7 years ago by Julien Phalip

Easy pickings: unset
Needs tests: set

Changed 6 years ago by Mark Lavin

Attachment: 7463.diff added

Updated patch with tests.

comment:6 Changed 6 years ago by Mark Lavin

Needs tests: unset
UI/UX: unset

Updated the patch to apply to latest trunk and included new valid patterns to localflavor tests.

Changed 6 years ago by Karen Tracey

Attachment: 7463-failingtests.diff added

comment:7 Changed 6 years ago by Karen Tracey

Patch needs improvement: set

This format isn't exactly familiar to me, but I'm not exactly an arbiter of common US phone number formats so I accept that it might be nice to support nnn/nnn-nnnn. However, I don't think nnn/nnn/nnnn nor nnn-nnn/nnnn should be accepted -- those are not mentioned in the original description and don't look at all valid to me, yet it seems they are acceptable with the patch. See additional tests I added that try to ensure these patterns are not accepted -- these tests fail with the patch.

comment:8 Changed 6 years ago by Aymeric Augustin

Keywords: localflavorsplit added
Resolution: invalid
Status: newclosed

django.contrib.localflavor is now deprecated — see

A repository was created for each localflavor at (Replace with the country code.)

If you're still interested in this ticket, could you create a pull request on that repository?

Sorry for not resolving this issue earlier, and thanks for your input!

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