def create_user(self, name, email, password=None):
    if (not email):
        raise ValueError('O email é obrigatório.')
    email = self.normalize_email(email)
    user = self.model(name=name, email=email)
    user.set_password(password)
    user.save(using=self._db)
    return user
def create_user(self, name, email, password=None):
    if (not email):
        raise ValueError('O email é obrigatório.')
    email = self.normalize_email(email)
    user = self.model(name=name, email=email)
    user.set_password(password)
    user.save(using=self._db)
    return user