Commits

Peter Sagerson committed 0aa5ed6 Merge

Merged in snanda85/django-auth-ldap (pull request #15)

Django 1.7 compatibility for using custom profile

  • Participants
  • Parent commits adb61f4, 2db803c

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