Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #8376 -- Use request.path and request.path_info at the right mo…

…ments when

serving data in the flatpage middleware. Patch from jcassee.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 1e1f7c5 commit d05d724165413c923de9094e3ecf5dd652f6c0c5 @malcolmt malcolmt committed
2  django/contrib/flatpages/
@@ -7,7 +7,7 @@ def process_response(self, request, response):
if response.status_code != 404:
return response # No need to check for a flatpage for non-404 responses.
- return flatpage(request, request.path)
+ return flatpage(request, request.path_info)
# Return the original response if any errors happened. Because this
# is a middleware, we can't assume the errors will be caught elsewhere.
except Http404:
2  django/contrib/flatpages/
@@ -20,7 +20,7 @@ def flatpage(request, url):
`flatpages.flatpages` object
if not url.endswith('/') and settings.APPEND_SLASH:
- return HttpResponseRedirect(url + "/")
+ return HttpResponseRedirect("%s/" % request.path)
if not url.startswith('/'):
url = "/" + url
f = get_object_or_404(FlatPage, url__exact=url, sites__id__exact=settings.SITE_ID)

0 comments on commit d05d724

Please sign in to comment.
Something went wrong with that request. Please try again.