Opened 5 years ago

Closed 4 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:


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)))

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by Alex

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

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

  • Cc yoan@… added

comment:4 Changed 4 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.