Improved user joined game server mutation #181

This commit is contained in:
Sven Heidemann 2023-02-12 20:00:47 +01:00
parent 667bb708d9
commit 9a8f8a13f6

View File

@ -63,7 +63,9 @@ class UserJoinedGameServerMutation(QueryABC):
user = self._users.get_user_by_id(input["userId"]) user = self._users.get_user_by_id(input["userId"])
self._can_user_mutate_data(user.server, UserRoleEnum.admin) 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() active.leaved_on = datetime.now()
settings: BaseServerSettings = self._base_helper.get_config(user.server.discord_server_id) settings: BaseServerSettings = self._base_helper.get_config(user.server.discord_server_id)