core: bug fixes

This commit is contained in:
undefined committed 2024-01-08 16:45:23 +08:00
1 parent 5369d8d5eb
commit b027505512
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -189,7 +189,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 && pdoc && !problem.canViewBy(pdoc, this.user)) throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN);
} else if (pdoc && !problem.canViewBy(pdoc, this.user)) throw new PermissionError(PERM.PERM_VIEW_PROBLEM_HIDDEN);
if (!canViewCode) {
rdoc.code = '';