Skip to content

Commit a84f56c

Browse files
KevinjilmeisterT
authored andcommitted
Fix viewForContestExternalIdAction implementation
During WF Luxor, multiple implementations were considered. This commit contains the definitive implementation used instead of commit f467913.
1 parent 57abaeb commit a84f56c

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

webapp/src/Controller/Jury/SubmissionController.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,23 +685,22 @@ public function viewForContestExternalIdAction(string $externalContestId, string
685685
{
686686
$contest = $this->em->getRepository(Contest::class)->findOneBy(['externalid' => $externalContestId]);
687687
if ($contest === null) {
688-
throw new NotFoundHttpException("Cannot find the contest with the given external id.");
688+
throw new NotFoundHttpException(sprintf('No contest found with external ID %s', $externalContestId));
689689
}
690690

691691
$submission = $this->em->getRepository(Submission::class)
692692
->findOneBy([
693-
'contest' => $this->dj->getCurrentContest(),
693+
'contest' => $contest,
694694
'externalid' => $externalId
695695
]);
696696

697697
if (!$submission) {
698698
throw new NotFoundHttpException(sprintf('No submission found with external ID %s', $externalId));
699699
}
700700

701-
$response = $this->redirectToRoute('jury_submission', [
701+
return $this->redirectToRoute('jury_submission', [
702702
'submitId' => $submission->getSubmitid(),
703703
]);
704-
return $this->dj->setCookie('domjudge_cid', (string)$contest->getCid(), 0, null, '', false, false, $response);
705704
}
706705

707706
#[Route(path: '/by-external-id/{externalId}', name: 'jury_submission_by_external_id')]

0 commit comments

Comments
 (0)