def create_user(self, email, username, password, ipaddr): self.secret = random_string() self.email = email self.username = username self._set_password(password) self.login_addr = ipaddr self.active_token = random_token() self.user_profile = UserProfile()
def _set_password(self, password): self.secret = random_string() self.login_sequence = random_token() self.password = hash_password(_u(password), self.secret)