Opened 5 years ago

Closed 5 years ago

#16133 closed Bug (fixed)

cannot access documentation django.contrib.admin

Reported by: anonymous Owned by: nobody
Component: *.djangoproject.com Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Change History (4)

comment:1 Changed 5 years ago by Aymeric Augustin

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Indeed, there's a bug in django_website/docs/views.py:

def redirect_index(request, *args, **kwargs):
    return redirect(request.path.rstrip('index/'))

This will strip all 'i', 'n', 'd', 'e', 'x' and '/' characters from the end of the URL. In this case, it will strip in/index. This is obviously wrong.

This function could be written like this:

def redirect_index(request, *args, **kwargs):
    assert request.path.endswith('index/')
    return redirect(request.path[:-6])

comment:2 Changed 5 years ago by Aymeric Augustin

Component: UncategorizedDjangoproject.com Web site
Type: UncategorizedBug

comment:3 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

#16419 was a duplicate.

comment:4 Changed 5 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top