Skip to content
Browse files

Fixed #6213: flatpage view now correctly redirects if settings.APPEND…

…_SLASH. Thanks, crankycoder.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 98d8acf commit d0f57e7c7385a112cb9e19d314352fc5ed5b0747 @jacobian jacobian committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/contrib/flatpages/
4 django/contrib/flatpages/
@@ -1,7 +1,7 @@
from django.contrib.flatpages.models import FlatPage
from django.template import loader, RequestContext
from django.shortcuts import get_object_or_404
-from django.http import HttpResponse
+from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.core.xheaders import populate_xheaders
from django.utils.safestring import mark_safe
@@ -19,6 +19,8 @@ def flatpage(request, url):
`flatpages.flatpages` object
+ if not url.endswith('/') and settings.APPEND_SLASH:
+ return HttpResponseRedirect(url + "/")
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 d0f57e7

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