1. Abraneo Technologies
  2. django-registration


James Bennett  committed 5b4c306

Make the signature match UserManager.create_user.

  • Participants
  • Parent commits 091c136
  • Branches default

Comments (0)

Files changed (3)

File registration/backends/default/__init__.py

View file
  • Ignore whitespace
     fields and supported operations.
-    def register(self, request, username, password, email):
+    def register(self, request, username, email, password):
         Given a username, email address and password, register a new
         user account, which will initially be inactive.
             site = Site.objects.get_current()
             site = RequestSite(request)
-        return RegistrationProfile.objects.create_inactive_user(username, password, email, site)
+        return RegistrationProfile.objects.create_inactive_user(username, email, password, site)
     def activate(self, request, activation_key):

File registration/models.py

View file
  • Ignore whitespace
                 return user
         return False
-    def create_inactive_user(self, username, password, email, site):
+    def create_inactive_user(self, username, email, password, site):
         Create a new, inactive ``User``, generate a
         ``RegistrationProfile`` and email its activation key to the

File registration/tests.py

View file
  • Ignore whitespace
-        new_user = self.backend.register({}, 'bob', 'secret', 'bob@example.com')
+        new_user = self.backend.register({}, 'bob', 'bob@example.com', 'secret')
         self.assertEqual(new_user.username, 'bob')
         self.assertEqual(new_user.email, 'bob@example.com')
         # First, test with a user activating inside the activation
         # window.
-        valid_user = self.backend.register({}, 'alice', 'swordfish', 'alice@example.com')
+        valid_user = self.backend.register({}, 'alice', 'alice@example.com', 'swordfish')
         valid_profile = RegistrationProfile.objects.get(user=valid_user)
         activated = self.backend.activate({}, valid_profile.activation_key)
         self.assertEqual(activated.username, valid_user.username)
         # Now test again, but with a user activating outside the
         # activation window.
-        expired_user = self.backend.register({}, 'bob', 'secret', 'bob@example.com')
+        expired_user = self.backend.register({}, 'bob', 'bob@example.com', 'secret')
         expired_user.date_joined = expired_user.date_joined - datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS)
         expired_profile = RegistrationProfile.objects.get(user=expired_user)