mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix contest pretest record update
This commit is contained in:
1 parent
c683685e7e
commit
43d589c84d
2 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.28.15",
|
"version": "2.28.16",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ class RecordMainConnectionHandler extends ConnectionHandler {
|
|||||||
async onRecordChange(rdoc: RecordDoc) {
|
async onRecordChange(rdoc: RecordDoc) {
|
||||||
if (rdoc.domainId !== this.domainId) return;
|
if (rdoc.domainId !== this.domainId) return;
|
||||||
if (!this.pretest && rdoc.input) return;
|
if (!this.pretest && rdoc.input) return;
|
||||||
if (rdoc.contest && rdoc.contest.tid.toString() !== this.tid) return;
|
if (!this.pretest && rdoc.contest && rdoc.contest.tid.toString() !== this.tid) return;
|
||||||
if (this.uid && rdoc.uid !== this.uid) return;
|
if (this.uid && rdoc.uid !== this.uid) return;
|
||||||
if (this.pid && (rdoc.pid !== this.pid || rdoc.pdomain !== this.pdomain)) return;
|
if (this.pid && (rdoc.pid !== this.pid || rdoc.pdomain !== this.pdomain)) return;
|
||||||
// eslint-disable-next-line prefer-const
|
// eslint-disable-next-line prefer-const
|
||||||
@@ -242,7 +242,7 @@ class RecordDetailConnectionHandler extends ConnectionHandler {
|
|||||||
@param('rid', Types.ObjectID)
|
@param('rid', Types.ObjectID)
|
||||||
async prepare(domainId: string, rid: ObjectID) {
|
async prepare(domainId: string, rid: ObjectID) {
|
||||||
const rdoc = await record.get(domainId, rid);
|
const rdoc = await record.get(domainId, rid);
|
||||||
if (rdoc.contest) {
|
if (rdoc.contest && rdoc.input === undefined) {
|
||||||
const tdoc = await contest.get(domainId, rdoc.contest.tid, -1);
|
const tdoc = await contest.get(domainId, rdoc.contest.tid, -1);
|
||||||
if (!contest.canShowRecord.call(this, tdoc)) throw new PermissionError(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);
|
if (!contest.canShowRecord.call(this, tdoc)) throw new PermissionError(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user