core: fix homework pretest

This commit is contained in:
undefined committed 2021-08-06 13:11:12 +08:00
1 parent 350716092a
commit efbc302d73
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.31.1",
"version": "2.31.2",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+1 -1
View File
@@ -234,7 +234,7 @@ class RecordMainConnectionHandler extends ConnectionHandler {
user.getById(this.domainId, rdoc.uid),
problem.get(rdoc.pdomain, rdoc.pid),
]);
const tdoc = this.tid ? await contest.get(this.domainId, new ObjectID(this.tid)) : null;
const tdoc = this.tid ? await contest.get(this.domainId, new ObjectID(this.tid), -1) : null;
if (pdoc && !rdoc.contest) {
if (pdoc.hidden && !this.user.own(pdoc) && !this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) pdoc = null;
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) pdoc = null;