Commits

Sandeep Nanda committed 2db803c

Django 1.7 compatibility for using custom profile

  • Participants
  • Parent commits 47760b4

Comments (0)

Files changed (1)

File django_auth_ldap/backend.py

 import pprint
 import copy
 
-from django.contrib.auth.models import User, Group, Permission, SiteProfileNotAvailable
+from django.contrib.auth.models import User, Group, Permission
 from django.core.cache import cache
 from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
 import django.dispatch
 except ImportError: # Django < 1.5
     from django.utils.encoding import smart_str as force_str
 
+# Django 1.7 Removed custom profiles
+try:
+    from django.contrib.auth.models import SiteProfileNotAvailable
+except ImportError:
+    SiteProfileNotAvailable = Exception
+
 # Support Django 1.5's custom user models
 try:
     from django.contrib.auth import get_user_model