Anonymous avatar Anonymous committed 01d205b

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

Comments (0)

Files changed (6)

registration/backends/simple/views.py

 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):
     """

registration/forms.py

 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):
     """

registration/tests/default_backend.py

 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):
     """

registration/tests/forms.py

 
 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):
     """

registration/tests/models.py

 
 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):
     """

registration/tests/simple_backend.py

 
 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'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.