Ticket #8376: 8376-r8418-2.diff

File 8376-r8418-2.diff, 1.2 KB (added by Joost Cassee, 16 years ago)
  • django/contrib/flatpages/middleware.py

     
    77        if response.status_code != 404:
    88            return response # No need to check for a flatpage for non-404 responses.
    99        try:
    10             return flatpage(request, request.path)
     10            return flatpage(request, request.path_info)
    1111        # Return the original response if any errors happened. Because this
    1212        # is a middleware, we can't assume the errors will be caught elsewhere.
    1313        except Http404:
  • django/contrib/flatpages/views.py

     
    2020            `flatpages.flatpages` object
    2121    """
    2222    if not url.endswith('/') and settings.APPEND_SLASH:
    23         return HttpResponseRedirect(url + "/")
     23        return HttpResponseRedirect(request.path + "/")
    2424    if not url.startswith('/'):
    2525        url = "/" + url
    2626    f = get_object_or_404(FlatPage, url__exact=url, sites__id__exact=settings.SITE_ID)
Back to Top