Commits

tejinderss committed cf8c3e3

Adding ability to let the newly created user in activated state

  • Participants
  • Parent commits 794d460

Comments (0)

Files changed (1)

File registration/models.py

         return False
 
     def create_inactive_user(self, username, email, password,
-                             site, send_email=True):
+                             site, send_email=True, active=False):
         """
         Create a new, inactive ``User``, generate a
         ``RegistrationProfile`` and email its activation key to the
 
         """
         new_user = get_user_model().objects.create_user(email, password)
-        new_user.is_active = False
-        new_user.save()
+        if not active:
+            new_user.is_active = False
+            new_user.save()
 
         registration_profile = self.create_profile(new_user)