core: fix homework record

This commit is contained in:
undefined committed 2021-09-16 21:46:41 +08:00
1 parent 1ded807088
commit 6deb824a8d
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.35.3",
"version": "2.35.4",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+1 -1
View File
@@ -40,7 +40,7 @@ class RecordListHandler extends Handler {
tdoc = await contest.get(domainId, tid, -1);
if (!tdoc) throw new ContestNotFoundError(domainId, pid);
if (!contest.canShowScoreboard.call(this, tdoc, true)) throw new PermissionError(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);
if (!this.user.own(tdoc) && !(await contest.getStatus(domainId, tid, this.user._id))?.attend) {
if (!this.user.own(tdoc) && !(await contest.getStatus(domainId, tid, this.user._id, -1))?.attend) {
throw new ContestNotAttendedError(domainId, tid);
}
}