Fix bug where 'dead' property of monkey wasn't defined

This commit is contained in:
Itay Mizeretz 2017-11-07 14:54:11 +02:00
parent 05ddc592ec
commit 1ad37b1dad
1 changed files with 1 additions and 0 deletions

View File

@ -53,6 +53,7 @@ class Monkey(flask_restful.Resource):
def post(self, **kw): def post(self, **kw):
monkey_json = json.loads(request.data) monkey_json = json.loads(request.data)
monkey_json['dead'] = False
if 'keepalive' in monkey_json: if 'keepalive' in monkey_json:
monkey_json['keepalive'] = dateutil.parser.parse(monkey_json['keepalive']) monkey_json['keepalive'] = dateutil.parser.parse(monkey_json['keepalive'])
else: else: