Permalink
Browse files

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
  • Loading branch information...
1 parent dbf2463 commit 965cdefad0a5578a964e4e5d9e8c9ffd2b256cbd @jkocherhans jkocherhans committed Apr 21, 2006
Showing with 5 additions and 9 deletions.
  1. +5 −9 django/contrib/auth/models.py
View
14 django/contrib/auth/models.py
@@ -207,15 +207,11 @@ def get_profile(self):
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):

0 comments on commit 965cdef

Please sign in to comment.