From 50d753a87b5f6bc4fe31e222a37796cf903133f7 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 24 May 2020 01:57:06 +0100 Subject: Convert codebase for python3 usage --- middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'middleware.py') diff --git a/middleware.py b/middleware.py index 7c27500..7699c6a 100644 --- a/middleware.py +++ b/middleware.py @@ -27,7 +27,7 @@ class SmartAppendSlashMiddleware(object): if settings.SMART_APPEND_SLASH and (not old_url[1].endswith('/')) and not _resolves(old_url[1]) and _resolves(old_url[1] + '/'): new_url[1] = new_url[1] + '/' if settings.DEBUG and request.method == 'POST': - raise RuntimeError, "You called this URL via POST, but the URL doesn't end in a slash and you have SMART_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 SMART_APPEND_SLASH=False in your Django settings." % (new_url[0], new_url[1]) + raise RuntimeError("You called this URL via POST, but the URL doesn't end in a slash and you have SMART_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 SMART_APPEND_SLASH=False in your Django settings." % (new_url[0], new_url[1])) if new_url != old_url: # Redirect if new_url[0]: -- cgit v1.2.3