Opened 15 years ago

Closed 15 years ago

#11456 closed (duplicate)

flatpages append slash not working with unicode urls

Reported by: hadaraz Owned by: nobody
Component: Contrib apps Version: 1.1-beta
Severity: Keywords: flatpages
Cc: yoan@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The append slash is currently:

if not url.endswith('/') and settings.APPEND_SLASH:
    return HttpResponseRedirect("%s/" % request.path)

It works fine for non-unicode urls. However, when using another regex for the url field which allows unicode chars in it, request.path needs to be quoted for the redirection to work:

if not url.endswith('/') and settings.APPEND_SLASH:
    return HttpResponseRedirect("%s/" % iri_to_uri(urlquote(request.path)))

Change History (4)

comment:1 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Yoan, 15 years ago

If you look into this ticket: #11522 there a more generic way of doing it as it should be handled by HttpResponseRedirect imho.

comment:3 by anonymous, 15 years ago

Cc: yoan@… added

comment:4 by Karen Tracey, 15 years ago

Resolution: duplicate
Status: newclosed

As noted above, #11522 is the underlying problem that needs to be fixed.

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