magic-removal: changed explicit settings import to qualified settings import in django.contrib.flatpages

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1996 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Georg Bauer 2006-01-16 15:04:06 +00:00
parent 0aca6e1d1d
commit abeb5681b4
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
from django.contrib.flatpages.views import flatpage
from django.http import Http404
from django.conf.settings import DEBUG
from django.conf import settings
class FlatpageFallbackMiddleware:
def process_response(self, request, response):
@ -13,6 +13,6 @@ class FlatpageFallbackMiddleware:
except Http404:
return response
except:
if DEBUG:
if settings.DEBUG:
raise
return response

View File

@ -2,7 +2,7 @@ from django.contrib.flatpages.models import FlatPage
from django.template import loader, RequestContext
from django.core.extensions import get_object_or_404
from django.http import HttpResponse
from django.conf.settings import SITE_ID
from django.conf import settings
DEFAULT_TEMPLATE = 'flatpages/default'
@ -19,7 +19,7 @@ def flatpage(request, url):
"""
if not url.startswith('/'):
url = "/" + url
f = get_object_or_404(FlatPage, url__exact=url, sites__id__exact=SITE_ID)
f = get_object_or_404(FlatPage, url__exact=url, sites__id__exact=settings.SITE_ID)
# If registration is required for accessing this page, and the user isn't
# logged in, redirect to the login page.
if f.registration_required and request.user.is_anonymous():