From ac3e09fb1983b318fd00a893ef775bd177e24399 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Tue, 21 May 2019 13:15:25 +0530 Subject: [PATCH] Fix state being True even if it is false. --- server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index f09c88b..3aba77c 100644 --- a/server.py +++ b/server.py @@ -235,7 +235,8 @@ def update_quest(db): else: return jsonify(errors._400_bv), 400 elif i == "state": - state = bool(request.values["state"]) + state = (True if str(request.values['state']).lower() + in ["1", "true"] else False) if state is True: quest.state = 1 else: @@ -294,7 +295,8 @@ def update_side_quest(db): else: return jsonify(errors._400_bv), 400 elif i == "state": - state = bool(request.values["state"]) + state = (True if str(request.values['state']).lower() + in ["1", "true"] else False) if state is True: quest.state = 1 else: