tejinderss avatar tejinderss committed cf8c3e3

Adding ability to let the newly created user in activated state

Comments (0)

Files changed (1)


         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)
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.