core: fix attend check

This commit is contained in:
undefined committed 2021-10-25 17:42:43 +08:00
1 parent b10c67f5cf
commit 00b2af4738
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -227,7 +227,7 @@ export class ProblemDetailHandler extends ProblemHandler {
const showAccept = contest.canShowScoreboard.call(this, this.tdoc, true);
if (!showAccept) this.pdoc.nAccept = 0;
if (contest.isNotStarted(this.tdoc)) throw new ContestNotLiveError(tid);
if (!contest.isDone(this.tdoc) && !this.tsdoc.attend) throw new ContestNotAttendedError(tid);
if (!contest.isDone(this.tdoc) && !this.tsdoc?.attend) throw new ContestNotAttendedError(tid);
} else if (this.pdoc.hidden && !this.user.own(this.pdoc)) {
this.checkPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN);
}