core: fix contest attended check

This commit is contained in:
undefined committed 2022-11-27 12:57:38 +08:00
1 parent a24fec2e7c
commit b1e5c77a56
1 file changed
+1 -1
+1 -1
View File
@@ -170,7 +170,7 @@ class RecordDetailHandler extends ContestDetailBaseHandler {
if (this.tdoc.allowViewCode && contest.isDone(this.tdoc)) {
canViewCode ||= tsdoc?.attend;
}
if (!tsdoc.attend && !problem.canViewBy(pdoc, this.user)) throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN);
if (!tsdoc?.attend && !problem.canViewBy(pdoc, this.user)) throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN);
} else if (!problem.canViewBy(pdoc, this.user)) throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN);
if (!canViewCode) {
rdoc.code = '';