1
0
mirror of https://github.com/django/django.git synced 2025-06-13 15:39:13 +00:00

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

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Georg Bauer 2006-01-16 15:00:42 +00:00
parent bae1f6815b
commit 22012296bd

View File

@ -197,16 +197,16 @@ class User(models.Model):
SiteProfileNotAvailable if this site does not allow profiles.
"""
if not hasattr(self, '_profile_cache'):
from django.conf.settings import AUTH_PROFILE_MODULE
if not AUTH_PROFILE_MODULE:
from django.conf import settings
if not settings.AUTH_PROFILE_MODULE:
raise SiteProfileNotAvailable
try:
app, mod = AUTH_PROFILE_MODULE.split('.')
app, mod = settings.AUTH_PROFILE_MODULE.split('.')
module = __import__('ellington.%s.apps.%s' % (app, mod), [], [], [''])
self._profile_cache = module.get_object(user_id=self.id)
except ImportError:
try:
module = __import__('django.models.%s' % AUTH_PROFILE_MODULE, [], [], [''])
module = __import__('django.models.%s' % settings.AUTH_PROFILE_MODULE, [], [], [''])
self._profile_cache = module.get_object(user__id__exact=self.id)
except ImportError:
raise SiteProfileNotAvailable