Browse Source

fix error in last_locaion

testing
Burathar 4 years ago
parent
commit
27dbedeae8
  1. 3
      app/models/user.py

3
app/models/user.py

@ -58,7 +58,8 @@ class User(UserMixin, db.Model):
return None return None
if game is None: if game is None:
return self.locations[-1] 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): 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''' '''Returns the role as Role enum of player in given game. Returns None if player does not participate in game'''

Loading…
Cancel
Save