mirror of
https://github.com/django/django.git
synced 2024-12-25 10:35:48 +00:00
Fixed #8344: make User.get_profile() work when settings.AUTH_PROFILE_MODULE is unset.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8543 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
15ed0d65b0
commit
9a1e4cedde
@ -286,7 +286,7 @@ class User(models.Model):
|
|||||||
"""
|
"""
|
||||||
if not hasattr(self, '_profile_cache'):
|
if not hasattr(self, '_profile_cache'):
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
if not settings.AUTH_PROFILE_MODULE:
|
if not getattr(settings, 'AUTH_PROFILE_MODULE', False):
|
||||||
raise SiteProfileNotAvailable
|
raise SiteProfileNotAvailable
|
||||||
try:
|
try:
|
||||||
app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.')
|
app_label, model_name = settings.AUTH_PROFILE_MODULE.split('.')
|
||||||
|
Loading…
Reference in New Issue
Block a user