def create_user(self, username, name, password, email, is_active=False, is_staff=False, is_superuser=False): user = User(username=username, name=name, password=self.hasher.encrypt(password), is_active=is_active, is_staff=is_staff, is_superuser=is_superuser) user.last_login = datetime.datetime.now() self.db.add(user) email_object = Email(email=email, user=user, primary=True, verified=False) self.db.add(email_object) # flush the db now so user.id is available self.db.flush() return user
def create_user(self, username, name, password, email, is_active=False, is_staff=False, is_superuser=False): user = User(username=username, name=name, password=password, is_active=is_active, is_staff=is_staff, is_superuser=is_superuser) user.last_login = datetime.datetime.now() self.db.add(user) email_object = Email(email=email, user=user, primary=True, verified=False) self.db.add(email_object) return user
def create_user(self, username, name, password): user = User(username=username, name=name, password=self.hasher.hash(password)) self.db.add(user) self.db.flush() # flush the db now so user.id is available return user
def create_user(self, username, name, password, is_active=False, is_staff=False, is_superuser=False): user = User(username=username, name=name, password=self.hasher.hash(password), is_active=is_active, is_staff=is_staff, is_superuser=is_superuser) self.db.add(user) self.db.flush() # flush the db now so user.id is available return user