|
|
|
@ -148,7 +148,7 @@ class Player(UserMixin, db.Model):
@@ -148,7 +148,7 @@ class Player(UserMixin, db.Model):
|
|
|
|
|
if not self.locations: |
|
|
|
|
return 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_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), |
|
|
|
|