Last active
December 21, 2015 08:49
-
-
Save MattTheRed/6280647 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomUserManager(CustomUserManager): | |
def create_user(self, email, | |
password=None): | |
user = self.model(email=email, password=password) | |
user.set_password(password) | |
user.save(using=self._db) | |
return user | |
def create_superuser(self, email, | |
password): | |
user = self.create_user(email, | |
password=password) | |
user.is_staff = True | |
user.is_admin = True | |
user.is_superuser = True | |
user.save(using=self._db) | |
return user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment