From 91f21f06416a30a9aebfce8a3d7199ec0f77a5b3 Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Mon, 16 Jan 2006 15:01:26 +0000 Subject: [PATCH] magic-removal: changed explicit settings import to qualified settings import django.contrib.redirects git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1993 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/redirects/middleware.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/django/contrib/redirects/middleware.py b/django/contrib/redirects/middleware.py index aa75f41152..1e87ffad95 100644 --- a/django/contrib/redirects/middleware.py +++ b/django/contrib/redirects/middleware.py @@ -1,6 +1,6 @@ from django.contrib.redirects.models import Redirect from django import http -from django.conf.settings import APPEND_SLASH, SITE_ID +from django.conf import settings class RedirectFallbackMiddleware: def process_response(self, request, response): @@ -8,13 +8,13 @@ class RedirectFallbackMiddleware: return response # No need to check for a redirect for non-404 responses. path = request.get_full_path() try: - r = Redirect.objects.get_object(site__id__exact=SITE_ID, old_path__exact=path) + r = Redirect.objects.get_object(site__id__exact=settings.SITE_ID, old_path__exact=path) except Redirect.DoesNotExist: r = None - if r is None and APPEND_SLASH: + if r is None and settings.APPEND_SLASH: # Try removing the trailing slash. try: - r = Redirect.objects.get_object(site__id__exact=SITE_ID, + r = Redirect.objects.get_object(site__id__exact=settings.SITE_ID, old_path__exact=path[:path.rfind('/')]+path[path.rfind('/')+1:]) except Redirect.DoesNotExist: pass