Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#24695 closed Bug (fixed)

URL regex has unnecessary _

Reported by: Lachlan Musicman Owned by: nobody
Component: Documentation Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

On this page:

https://docs.djangoproject.com/en/1.8/ref/class-based-views/generic-display/

Under myapps/urls.py in the DetailView

...

urlpatterns = [
    url(r'^(?P<slug>[-_\w]+)/$', ArticleDetailView.as_view(), name='article-detail'),
]

The _ is unnecessary, as it's already in \w

The regex should read

?P<slug>[-\w]+

Change History (3)

comment:1 Changed 3 years ago by Alasdair Nicol

Has patch: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In b9e972b:

Fixed #24695 -- Tidied up a couple of regexes in the CBV docs

Thanks datakid for the report

comment:3 Changed 3 years ago by Tim Graham <timograham@…>

In 415a65fc:

[1.8.x] Fixed #24695 -- Tidied up a couple of regexes in the CBV docs

Thanks datakid for the report

Backport of b9e972b96171236c40a8a922c62d36b49854ee52 from master

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