From 27dbedeae886804c875c0907f67c2faf308dda2b Mon Sep 17 00:00:00 2001 From: Burathar Date: Wed, 22 Jul 2020 20:48:46 +0200 Subject: [PATCH] fix error in last_locaion --- app/models/user.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.py b/app/models/user.py index d38bfd5..b679d82 100644 --- a/app/models/user.py +++ b/app/models/user.py @@ -58,7 +58,8 @@ class User(UserMixin, db.Model): return None if game is None: return self.locations[-1] - return self.locations_during_game(game)[-1] + locations_during_game = self.locations_during_game(game) + return locations_during_game[-1] if locations_during_game else None def role_in_game(self, game): '''Returns the role as Role enum of player in given game. Returns None if player does not participate in game'''