summaryrefslogtreecommitdiff
path: root/django/middleware/common.py
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2006-06-19 15:23:57 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2006-06-19 15:23:57 +0000
commitadf4b9311d5d64a2bdd58da50271c121ea22e397 (patch)
treea69b3b023595cf1ce67a14c4c1ecd3290d94088e /django/middleware/common.py
parente976ed1f7910fad03704f88853c5c5b36cbab134 (diff)
downloaddjango-attic/multi-auth.tar.gz
multi-auth: Merged to [3151]archive/attic/multi-authattic/multi-auth
git-svn-id: http://code.djangoproject.com/svn/django/branches/multi-auth@3152 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/middleware/common.py')
-rw-r--r--django/middleware/common.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/middleware/common.py b/django/middleware/common.py
index 763918878a..acd3233e1d 100644
--- a/django/middleware/common.py
+++ b/django/middleware/common.py
@@ -3,7 +3,7 @@ from django import http
from django.core.mail import mail_managers
import md5, os
-class CommonMiddleware:
+class CommonMiddleware(object):
"""
"Common" middleware for taking care of some basic operations:
@@ -39,6 +39,8 @@ class CommonMiddleware:
# trailing slash or a file extension.
if settings.APPEND_SLASH and (old_url[1][-1] != '/') and ('.' not in old_url[1].split('/')[-1]):
new_url[1] = new_url[1] + '/'
+ if settings.DEBUG and request.META['REQUEST_METHOD'].lower() == 'post':
+ raise RuntimeError, "You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to %s%s (note the trailing slash), or set APPEND_SLASH=False in your Django settings." % (new_url[0], new_url[1])
if new_url != old_url:
# Redirect
if new_url[0]: