logic looks wrong

I don't understand what's going on here, but the logic looks wrong:
if tmp_data['result'] is True, an error is raised ... ?