Skip to content

Commit 54aa41f

Browse files
committed
Don't display future clarifications to teams
Only time where this can ever happen is a replay of a contest but change is trivial enough.
1 parent cf2478c commit 54aa41f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

webapp/src/Controller/Team/MiscController.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ public function homeAction(Request $request): Response
9292
paginated: false
9393
)[0];
9494

95-
/** @var Clarification[] $clarifications */
96-
$clarifications = $this->em->createQueryBuilder()
95+
$qb = $this->em->createQueryBuilder()
9796
->from(Clarification::class, 'c')
9897
->leftJoin('c.problem', 'p')
9998
->leftJoin('c.sender', 's')
@@ -105,9 +104,14 @@ public function homeAction(Request $request): Response
105104
->setParameter('contest', $contest)
106105
->setParameter('team', $team)
107106
->addOrderBy('c.submittime', 'DESC')
108-
->addOrderBy('c.clarid', 'DESC')
109-
->getQuery()
110-
->getResult();
107+
->addOrderBy('c.clarid', 'DESC');
108+
if (!$this->dj->checkrole('jury')) {
109+
$qb->andWhere('c.submittime <= :time')
110+
->setparameter('time', time());
111+
}
112+
113+
/** @var Clarification[] $clarifications */
114+
$clarifications = $qb->getQuery()->getResult();
111115

112116
/** @var Clarification[] $clarificationRequests */
113117
$clarificationRequests = $this->em->createQueryBuilder()

0 commit comments

Comments
 (0)