File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
webapp/src/Controller/Jury Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 3
3
namespace App \Controller \Jury ;
4
4
5
5
use App \DataTransferObject \SubmissionRestriction ;
6
+ use App \Entity \ExternalContestSource ;
6
7
use App \Service \ConfigurationService ;
7
8
use Doctrine \ORM \EntityManagerInterface ;
8
9
use Doctrine \ORM \NonUniqueResultException ;
@@ -64,6 +65,19 @@ public function indexAction(
64
65
return $ this ->redirectToRoute ('jury_index ' );
65
66
}
66
67
68
+ /** @var ExternalContestSource|null $externalContestSource */
69
+ $ externalContestSource = $ this ->em ->createQueryBuilder ()
70
+ ->from (ExternalContestSource::class, 'ecs ' )
71
+ ->select ('ecs ' )
72
+ ->andWhere ('ecs.contest = :contest ' )
73
+ ->setParameter ('contest ' , $ this ->dj ->getCurrentContest ())
74
+ ->getQuery ()->getOneOrNullResult ();
75
+
76
+ if (!$ externalContestSource ) {
77
+ $ this ->addFlash ('warning ' , 'No external contest present yet, please configure one first ' );
78
+ return $ this ->redirectToRoute ('jury_external_contest_manage ' );
79
+ }
80
+
67
81
// Close the session, as this might take a while and we don't need the session below.
68
82
$ this ->requestStack ->getSession ()->save ();
69
83
You can’t perform that action at this time.
0 commit comments