Opened 6 years ago

Closed 6 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: UI/UX:

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 Changed 6 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by Yoan

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 Changed 6 years ago by anonymous

  • Cc yoan@… added

comment:4 Changed 6 years ago by kmtracey

  • Resolution set to duplicate
  • Status changed from new to closed

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

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