From a4ea0dfc417552ed78e9e2091b65ef6a2c000ab7 Mon Sep 17 00:00:00 2001 From: julius Date: Sun, 25 May 2025 21:13:28 +0200 Subject: [PATCH] fix: don't show times of players not in the team --- cutt/analysis.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cutt/analysis.py b/cutt/analysis.py index 7266e34..cfb1601 100644 --- a/cutt/analysis.py +++ b/cutt/analysis.py @@ -320,10 +320,17 @@ def last_submissions( ): times = {} with Session(engine) as session: + player_ids = session.exec( + select(P.id) + .join(PlayerTeamLink) + .join(Team) + .where(Team.id == request.team_id, P.disabled == False) + ).all() for survey in [C, PT, R]: subquery = ( select(survey.user, func.max(survey.time).label("latest")) .where(survey.team == request.team_id) + .where(survey.user.in_(player_ids)) .group_by(survey.user) .subquery() )