From b752a2ddad026ca94088b7818c7ef5c247001a1b Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 16 Feb 2022 01:02:48 +0200 Subject: [PATCH] gf --- files/routes/comments.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 9f1e9dd4f..41466d654 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -1036,14 +1036,15 @@ def unsave_comment(cid, v): @auth_required def handle_blackjack_action(cid, v): comment = get_comment(cid) - action = request.values.get("action", "") + if 'active' in comment.blackjack_result: + action = request.values.get("action", "") - if action == 'hit': player_hit(comment) - elif action == 'stay': player_stayed(comment) - - g.db.add(comment) - g.db.add(v) - g.db.commit() + if action == 'hit': player_hit(comment) + elif action == 'stay': player_stayed(comment) + + g.db.add(comment) + g.db.add(v) + g.db.commit() return { "message" : "..." } @app.post("/wordle/")