1. John Costa
  2. django-registration

Commits

Charles Hathaway  committed 01d205b

Propegated the fix to models.py throughout, anywhere from django.contrib.auth.models import User was used

  • Participants
  • Parent commits 8f242e3
  • Branches default

Comments (0)

Files changed (6)

File registration/backends/simple/views.py

View file
 from registration import signals
 from registration.views import RegistrationView as BaseRegistrationView
 
+try:
+    from django.contrib.auth import get_user_model
+    User = get_user_model()
+except ImportError:
+    from django.contrib.auth.models import User
+
 
 class RegistrationView(BaseRegistrationView):
     """

File registration/forms.py

View file
 from django import forms
 from django.utils.translation import ugettext_lazy as _
 
+try:
+    from django.contrib.auth import get_user_model
+    User = get_user_model()
+except ImportError:
+    from django.contrib.auth.models import User
+
 
 class RegistrationForm(forms.Form):
     """

File registration/tests/default_backend.py

View file
 from registration.backends.default.views import RegistrationView
 from registration.models import RegistrationProfile
 
+try:
+    from django.contrib.auth import get_user_model
+    User = get_user_model()
+except ImportError:
+    from django.contrib.auth.models import User
+
 
 class DefaultBackendViewTests(TestCase):
     """

File registration/tests/forms.py

View file
 
 from registration import forms
 
+try:
+    from django.contrib.auth import get_user_model
+    User = get_user_model()
+except ImportError:
+    from django.contrib.auth.models import User
+
 
 class RegistrationFormTests(TestCase):
     """

File registration/tests/models.py

View file
 
 from registration.models import RegistrationProfile
 
+try:
+    from django.contrib.auth import get_user_model
+    User = get_user_model()
+except ImportError:
+    from django.contrib.auth.models import User
+
 
 class RegistrationModelTests(TestCase):
     """

File registration/tests/simple_backend.py

View file
 
 from registration.forms import RegistrationForm
 
+try:
+    from django.contrib.auth import get_user_model
+    User = get_user_model()
+except ImportError:
+    from django.contrib.auth.models import User
+
 
 class SimpleBackendViewTests(TestCase):
     urls = 'registration.backends.simple.urls'