Skip to content

Commit

Permalink
Fixing bug in group exam fetching.
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed May 24, 2024
1 parent 2e8120d commit 8c3878f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/model/repository/GroupExams.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public function __construct(EntityManagerInterface $em)
public function findPendingForGroup(Group $group): ?GroupExam
{
$begin = $group->getExamBegin();
if (!$begin || !$group->hasExamPeriodSet()) {
return null;
}

$exam = $this->findBy(["group" => $group, "begin" => $begin]);
if (count($exam) > 1) {
throw new Exception("Data corruption, there is more than one group exam starting at the same time.");
Expand Down

0 comments on commit 8c3878f

Please sign in to comment.