mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
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
This commit is contained in:
parent
dbf2463cd6
commit
965cdefad0
@ -207,14 +207,10 @@ 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:
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user