Opened 8 years ago

Closed 4 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@… 8 years ago.
patch: allow forward slash as areacode delimiter
7463.diff (1.5 KB) - added by mlavin 5 years ago.
Updated patch with tests.
7463-failingtests.diff (1.7 KB) - added by kmtracey 5 years ago.

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by kevin@…

patch: allow forward slash as areacode delimiter

comment:1 Changed 8 years ago by ericholscher

  • milestone set to post-1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 8 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:3 Changed 5 years ago by gabrielhurley

  • Component changed from Contrib apps to contrib.localflavor

comment:4 Changed 5 years ago by lukeplant

  • Severity set to Normal
  • Type set to New feature

comment:5 Changed 5 years ago by julien

  • Easy pickings unset
  • Needs tests set

Changed 5 years ago by mlavin

Updated patch with tests.

comment:6 Changed 5 years ago by mlavin

  • Needs tests unset
  • UI/UX unset

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

Changed 5 years ago by kmtracey

comment:7 Changed 5 years ago by kmtracey

  • 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 4 years ago by aaugustin

  • Keywords localflavorsplit added
  • Resolution set to invalid
  • Status changed from new to closed

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