Skip to content

Commit ee3f47f

Browse files
committed
Exclude disabled teams from api/teams endpoint.
Also add a flash message in the jury interface when viewing a disabled team. Fixes #3205
1 parent 8287a25 commit ee3f47f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

webapp/src/Controller/API/TeamController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ protected function getQueryBuilder(Request $request): QueryBuilder
308308
->leftJoin('t.category', 'tc')
309309
->leftJoin('t.contests', 'c')
310310
->leftJoin('tc.contests', 'cc')
311-
->select('t, ta');
311+
->select('t, ta')
312+
->andWhere('t.enabled = 1');
312313

313314
if ($request->query->has('category')) {
314315
$queryBuilder

webapp/src/Controller/Jury/TeamController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ public function viewAction(
241241
throw new NotFoundHttpException(sprintf('Team with ID %s not found', $teamId));
242242
}
243243

244+
if (!$team->getEnabled()) {
245+
$this->addFlash('danger', 'Team is disabled and currently excluded from the scoreboard');
246+
}
247+
244248
$data = [
245249
'refresh' => [
246250
'after' => 15,

0 commit comments

Comments
 (0)