Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote branch 'justinlilly/14862_bad_links' into community_redux

  • Loading branch information...
commit 9d437001723175629df246fc4e3fe1e54cd9bc16 2 parents f9779dd + 4207cf6
@jacobian jacobian authored
Showing with 8 additions and 0 deletions.
  1. +4 −0 django_website/docs/views.py
  2. +4 −0 django_website/urls/docs.py
View
4 django_website/docs/views.py
@@ -3,6 +3,7 @@
import datetime
import django.views.static
from django.core import urlresolvers
+from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.utils import simplejson
@@ -59,6 +60,9 @@ def objects_inventory(request, lang, version):
response['Content-Type'] = "text/plain"
return response
+def redirect_index(request, *args, **kwargs):
+ return HttpResponseRedirect(request.path.rstrip('index/'))
+
class DocSearchView(haystack.views.SearchView):
def __init__(self, **kwargs):
kwargs.update({
View
4 django_website/urls/docs.py
@@ -37,6 +37,10 @@
views.source,
),
url(
+ r'^(.*)/index/$',
+ views.redirect_index,
+ ),
+ url(
r'^(?P<lang>[a-z-]+)/(?P<version>[\w.-]+)/(?P<url>[\w./-]*)/$',
views.document,
name = 'document-detail',
Please sign in to comment.
Something went wrong with that request. Please try again.