Code

Opened 6 years ago

Closed 18 months 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

Description

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)

forms.py.patch (960 bytes) - added by kevin@… 6 years ago.
patch: allow forward slash as areacode delimiter
7463.diff (1.5 KB) - added by mlavin 2 years ago.
Updated patch with tests.
7463-failingtests.diff (1.7 KB) - added by kmtracey 2 years ago.

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by kevin@…

patch: allow forward slash as areacode delimiter

comment:1 Changed 6 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 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:3 Changed 3 years ago by gabrielhurley

  • Component changed from Contrib apps to contrib.localflavor

comment:4 Changed 3 years ago by lukeplant

  • Severity set to Normal
  • Type set to New feature

comment:5 Changed 3 years ago by julien

  • Easy pickings unset
  • Needs tests set

Changed 2 years ago by mlavin

Updated patch with tests.

comment:6 Changed 2 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 2 years ago by kmtracey

comment:7 Changed 2 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 18 months ago by aaugustin

  • Keywords localflavor, forms, areacode, delimiter, localflavorsplit added; localflavor forms areacode delimiter removed
  • Resolution set to invalid
  • Status changed from new to closed

django.contrib.localflavor is now deprecated — see https://docs.djangoproject.com/en/dev/ref/contrib/localflavor/

A repository was created for each localflavor at https://github.com/django/django-localflavor-? (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!

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.