From 9a8f8a13f6d23d17c7d7a6c8c39ae373b7ab6d0c Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 12 Feb 2023 20:00:47 +0100 Subject: [PATCH] Improved user joined game server mutation #181 --- .../bot_graphql/mutations/user_joined_game_server_mutation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kdb-bot/src/bot_graphql/mutations/user_joined_game_server_mutation.py b/kdb-bot/src/bot_graphql/mutations/user_joined_game_server_mutation.py index ffdb2661..d36487a9 100644 --- a/kdb-bot/src/bot_graphql/mutations/user_joined_game_server_mutation.py +++ b/kdb-bot/src/bot_graphql/mutations/user_joined_game_server_mutation.py @@ -63,7 +63,9 @@ class UserJoinedGameServerMutation(QueryABC): user = self._users.get_user_by_id(input["userId"]) self._can_user_mutate_data(user.server, UserRoleEnum.admin) - active = self._user_joined_game_servers.get_active_user_joined_game_server_by_user_id(user.user_id) + active = self._user_joined_game_servers.find_active_user_joined_game_server_by_user_id(user.user_id) + if active is None: + return None active.leaved_on = datetime.now() settings: BaseServerSettings = self._base_helper.get_config(user.server.discord_server_id)