From 6be60f964f049a3241e301ed6ddf98d36cfc1f72 Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Sat, 29 Nov 2025 15:46:56 +0100 Subject: [PATCH] Exclude disabled teams from api/teams endpoint. Also add a flash message in the jury interface when viewing a disabled team. Fixes #3205 --- webapp/src/Controller/API/TeamController.php | 3 ++- webapp/src/Controller/Jury/TeamController.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/webapp/src/Controller/API/TeamController.php b/webapp/src/Controller/API/TeamController.php index db5e8f017e..27788adb34 100644 --- a/webapp/src/Controller/API/TeamController.php +++ b/webapp/src/Controller/API/TeamController.php @@ -308,7 +308,8 @@ protected function getQueryBuilder(Request $request): QueryBuilder ->leftJoin('t.category', 'tc') ->leftJoin('t.contests', 'c') ->leftJoin('tc.contests', 'cc') - ->select('t, ta'); + ->select('t, ta') + ->andWhere('t.enabled = 1'); if ($request->query->has('category')) { $queryBuilder diff --git a/webapp/src/Controller/Jury/TeamController.php b/webapp/src/Controller/Jury/TeamController.php index fbc4f2485c..54522fcf26 100644 --- a/webapp/src/Controller/Jury/TeamController.php +++ b/webapp/src/Controller/Jury/TeamController.php @@ -241,6 +241,10 @@ public function viewAction( throw new NotFoundHttpException(sprintf('Team with ID %s not found', $teamId)); } + if (!$team->getEnabled()) { + $this->addFlash('danger', 'Team is disabled and currently excluded from the scoreboard'); + } + $data = [ 'refresh' => [ 'after' => 15,