Handle exception if there is not user profile model set

This commit is contained in:
Camilo Nova 2013-04-20 18:15:32 -05:00
parent 61f3ec462c
commit 5ed5c90b9c

View file

@ -7,6 +7,7 @@ from django.conf import settings
from django.contrib.auth import logout
from django.db.models.loading import get_model
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import SiteProfileNotAvailable
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
@ -132,7 +133,7 @@ def is_user_lockable(request):
try:
profile = user.get_profile()
except ObjectDoesNotExist:
except SiteProfileNotAvailable, ObjectDoesNotExist:
# no profile
return True