From bdc61af997fcce369f1acd0f45d42490e152541d Mon Sep 17 00:00:00 2001 From: Burathar Date: Sun, 19 Jul 2020 17:37:50 +0200 Subject: [PATCH] fix Times Caught column --- app/models/game_player.py | 4 ++-- app/templates/game_hunter_dashboard.html | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/game_player.py b/app/models/game_player.py index 4690e05..fd0e99b 100644 --- a/app/models/game_player.py +++ b/app/models/game_player.py @@ -31,8 +31,8 @@ class GamePlayer(db.Model): found_objectives = association_proxy('player_found_objectives', 'objective', creator=lambda objective: PlayerFoundObjective(objective=objective)) - caught_by_players = association_proxy('player_caught_by_players', 'caught_player') - caught_players = association_proxy('player_caught_players', 'catching_player') + caught_by_players = association_proxy('player_caught_by_players', 'catching_player') + caught_players = association_proxy('player_caught_players', 'caught_player') def last_location(self): # pylint: disable=no-member diff --git a/app/templates/game_hunter_dashboard.html b/app/templates/game_hunter_dashboard.html index 84ad391..b826707 100644 --- a/app/templates/game_hunter_dashboard.html +++ b/app/templates/game_hunter_dashboard.html @@ -24,16 +24,16 @@ - {% for player in game.bunnies() %} + {% for bunny in game.bunnies() %} - {{ player.user.name }} - {{ player.caught_by_players | selectattr('catching_player', '==', current_user.player_in(game)) |list|length}} - {% with location = player.user.last_location(game) %} + {{ bunny.user.name }} + {{ bunny.player_caught_by_players | selectattr('catching_player', '==', current_user.player_in(game)) |list|length}} + {% with location = bunny.user.last_location(game) %} {% if location %}{{ moment(location.timestamp).fromNow()}}: {% endif %} {{ location }} {% endwith %} - +