core: fix contest attended check

pull/468/head
undefined 2 years ago
parent a24fec2e7c
commit b1e5c77a56

@ -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 = '';

Loading…
Cancel
Save