Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 965cdefad0a5578a964e4e5d9e8c9ffd2b256cbd 1 parent dbf2463
Joseph Kocherhans authored April 21, 2006

Showing 1 changed file with 5 additions and 9 deletions. Show diff stats Hide diff stats

  1. 14  django/contrib/auth/models.py
14  django/contrib/auth/models.py
@@ -207,15 +207,11 @@ def get_profile(self):
207 207
             if not settings.AUTH_PROFILE_MODULE:
208 208
                 raise SiteProfileNotAvailable
209 209
             try:
210  
-                app, mod = settings.AUTH_PROFILE_MODULE.split('.')
211  
-                module = __import__('ellington.%s.apps.%s' % (app, mod), [], [], [''])
212  
-                self._profile_cache = module.get(user_id=self.id)
213  
-            except ImportError:
214  
-                try:
215  
-                    module = __import__('django.models.%s' % settings.AUTH_PROFILE_MODULE, [], [], [''])
216  
-                    self._profile_cache = module.get(user__id__exact=self.id)
217  
-                except ImportError:
218  
-                    raise SiteProfileNotAvailable
  210
+                app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.')
  211
+                model = models.get_model(app_label, model_name)
  212
+                self._profile_cache = model._default_manager.get(user__id__exact=self.id)
  213
+            except ImportError, ImproperlyConfigured:
  214
+                raise SiteProfileNotAvailable
219 215
         return self._profile_cache
220 216
 
221 217
 class Message(models.Model):

0 notes on commit 965cdef

Please sign in to comment.
Something went wrong with that request. Please try again.