def set_password(self, password): """ Sets the instance's password hash to match the hash of the provided string.""" password, salt = generate_user_hash_and_salt(password) self['password'] = password self['salt'] = salt self.save()
def generate_hash_and_salt(self, password): return generate_user_hash_and_salt(password)