Skip to content

Commit

Permalink
game: Allow leaving not-started game, even if you're one of the last …
Browse files Browse the repository at this point in the history
…two players

Fixes #10
  • Loading branch information
mhthies committed May 4, 2020
1 parent cd23cfe commit 8508ba8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qaqa_bot/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def leave_game(self, session: Session, chat_id: int, user_id: int) -> None:
.filter(model.Participant.game == game)\
.scalar()

if num_participants <= 2:
if num_participants <= 2 and game.is_started:
logger.debug("Cannot remove user from game %s, since they are one of 2 or less remaining participants",
game.id)
self._send_messages([Message(chat_id, GetText("You are one of the last two participants of this game. Thus,"
Expand Down

0 comments on commit 8508ba8

Please sign in to comment.