Commits

David Chambers committed 74b1d75

Added 301 redirect for category Markdown requests.

Comments (0)

Files changed (1)

 
 from django.core.mail import EmailMultiAlternatives, send_mail
 from django.core.urlresolvers import reverse
-from django.http import Http404, HttpResponse, HttpResponseRedirect
+from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect
 from django.shortcuts import render_to_response
 from django.template.loader import render_to_string
 
         raise Http404
 
     if os.path.isdir(filepath):
-        #TODO - if view_source is true what do we do here?
+        if view_source:
+            return HttpResponsePermanentRedirect('../')
+
         #TODO - caching
         match = re.match(RE['alias=>canon'], os.path.split(filepath)[1])
         return render_to_response('category.dhtml', dict({