Fix doPost handler generation in python script

One condition was ommited when handling doPost generator