core: record: fix projection

This commit is contained in:
undefined committed 2023-11-30 20:31:53 +08:00
1 parent 0f0124b69b
commit 323f6b72f1
1 file changed
+1 -1
+1 -1
View File
@@ -331,9 +331,9 @@ class RecordMainConnectionHandler extends ConnectionHandler {
if (!problem.canViewBy(pdoc, this.user)) pdoc = null; if (!problem.canViewBy(pdoc, this.user)) pdoc = null;
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) pdoc = null; if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) pdoc = null;
} }
if (this.applyProjection && typeof rdoc.input !== 'string') rdoc = contest.applyProjection(tdoc, rdoc, this.user);
if (this.pretest) this.send({ rdoc: omit(rdoc, ['code', 'input']) }); if (this.pretest) this.send({ rdoc: omit(rdoc, ['code', 'input']) });
else { else {
if (this.applyProjection) rdoc = contest.applyProjection(tdoc, rdoc, this.user);
this.send({ this.send({
html: await this.renderHTML('record_main_tr.html', { html: await this.renderHTML('record_main_tr.html', {
rdoc, udoc, pdoc, tdoc, allDomain: this.allDomain, rdoc, udoc, pdoc, tdoc, allDomain: this.allDomain,