summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2006-04-21 21:09:19 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2006-04-21 21:09:19 +0000
commit965cdefad0a5578a964e4e5d9e8c9ffd2b256cbd (patch)
tree8e1b8bf957d5ce49dc62be7a7d79d7066e175743
parentdbf2463cd62002919671e12325f02b2c8b741196 (diff)
magic-removal: fixed part of #1659... references to django.models in django/contrib/auth/models.py Thanks ubernostrum.
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/auth/models.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py
index 79f7cbc760..a9c8883bf8 100644
--- a/django/contrib/auth/models.py
+++ b/django/contrib/auth/models.py
@@ -207,15 +207,11 @@ class User(models.Model):
if not settings.AUTH_PROFILE_MODULE:
raise SiteProfileNotAvailable
try:
- app, mod = settings.AUTH_PROFILE_MODULE.split('.')
- module = __import__('ellington.%s.apps.%s' % (app, mod), [], [], [''])
- self._profile_cache = module.get(user_id=self.id)
- except ImportError:
- try:
- module = __import__('django.models.%s' % settings.AUTH_PROFILE_MODULE, [], [], [''])
- self._profile_cache = module.get(user__id__exact=self.id)
- except ImportError:
- raise SiteProfileNotAvailable
+ app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.')
+ model = models.get_model(app_label, model_name)
+ self._profile_cache = model._default_manager.get(user__id__exact=self.id)
+ except ImportError, ImproperlyConfigured:
+ raise SiteProfileNotAvailable
return self._profile_cache
class Message(models.Model):