From 3502790333697bde63361d50eb3e764a1dbf2998 Mon Sep 17 00:00:00 2001 From: Jonas Weinz Date: Mon, 1 Apr 2019 16:25:16 +0200 Subject: [PATCH] fixing match revoke --- match_manager.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/match_manager.py b/match_manager.py index 9e3b77a..7f0f9d0 100644 --- a/match_manager.py +++ b/match_manager.py @@ -131,12 +131,15 @@ class MatchManager(object): player_b_name=entry['user_b'], json_state=entry['match_state']) if (not match.game_over): + match.game_over = True - # check who is the current player who did not make the move in time: - match.player_won = match.player_b_name if match.is_player_a else match.player_a_name + if match.complete_field.__contains__(Match.FIELD_USER_A) and match.complete_field.__contains__(Match.FIELD_USER_B): - self.update_match(entry['id'], match, False) + # check who is the current player who did not make the move in time: + match.player_won = match.player_b_name if match.is_player_a else match.player_a_name + + self.update_match(entry['id'], match, False) # delete matches from db: