Ticket #8376: 8376-r8418-2.diff
File 8376-r8418-2.diff, 1.2 KB (added by , 16 years ago) |
---|
-
django/contrib/flatpages/middleware.py
7 7 if response.status_code != 404: 8 8 return response # No need to check for a flatpage for non-404 responses. 9 9 try: 10 return flatpage(request, request.path )10 return flatpage(request, request.path_info) 11 11 # Return the original response if any errors happened. Because this 12 12 # is a middleware, we can't assume the errors will be caught elsewhere. 13 13 except Http404: -
django/contrib/flatpages/views.py
20 20 `flatpages.flatpages` object 21 21 """ 22 22 if not url.endswith('/') and settings.APPEND_SLASH: 23 return HttpResponseRedirect( url+ "/")23 return HttpResponseRedirect(request.path + "/") 24 24 if not url.startswith('/'): 25 25 url = "/" + url 26 26 f = get_object_or_404(FlatPage, url__exact=url, sites__id__exact=settings.SITE_ID)