Skip to content

Commit 57bbb13

Browse files
elderingvmcj
authored andcommitted
Fix logic error and update the comment.
This formulation requires less negations, which tends to be a source of mistakes interpreting logical expressions. (cherry picked from commit 46449e8)
1 parent a217393 commit 57bbb13

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

webapp/src/Controller/API/JudgementController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ protected function getQueryBuilder(Request $request): QueryBuilder
150150

151151
$specificJudgingRequested = $request->attributes->has('id')
152152
|| $request->query->has('ids');
153-
// If we don't have correct permissions or didn't request a specific
154-
// judging (necessary for the event log), then exclude some judgings:
155-
if (!$roleAllowsVisibility && !$specificJudgingRequested) {
153+
// Only include invalid or too late submissions if the role allows it
154+
// and we request these specific submissions.
155+
if (!($roleAllowsVisibility && $specificJudgingRequested)) {
156156
$queryBuilder
157157
->andWhere('s.submittime < c.endtime')
158158
->andWhere('j.valid = 1');

0 commit comments

Comments
 (0)