|
|
@ -148,7 +148,7 @@ class Player(UserMixin, db.Model): |
|
|
|
if not self.locations: |
|
|
|
if not self.locations: |
|
|
|
return None |
|
|
|
return None |
|
|
|
if game is None: |
|
|
|
if game is None: |
|
|
|
return max(location for location in self.locations) |
|
|
|
return max((location for location in self.locations), key=lambda location: location.timestamp) |
|
|
|
game_start = game.start_time or datetime.min |
|
|
|
game_start = game.start_time or datetime.min |
|
|
|
game_end = game.end_time or datetime.max |
|
|
|
game_end = game.end_time or datetime.max |
|
|
|
return max((location for location in self.locations if location.timestamp > game_start and location.timestamp < game_end), |
|
|
|
return max((location for location in self.locations if location.timestamp > game_start and location.timestamp < game_end), |
|
|
|