mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: fix record display
This commit is contained in:
1 parent
71bb2f0b51
commit
42f41c4f61
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.39.3",
|
"version": "2.39.4",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class RecordDetailHandler extends Handler {
|
|||||||
this.response.template = 'record_detail.html';
|
this.response.template = 'record_detail.html';
|
||||||
const rdoc = await record.get(domainId, rid);
|
const rdoc = await record.get(domainId, rid);
|
||||||
if (!rdoc) throw new RecordNotFoundError(rid);
|
if (!rdoc) throw new RecordNotFoundError(rid);
|
||||||
if (rdoc.contest.toHexString() === '000000000000000000000000') {
|
if (rdoc.contest?.toHexString() === '000000000000000000000000') {
|
||||||
if (rdoc.uid !== this.user._id) throw new PermissionError(PERM.PERM_READ_RECORD_CODE);
|
if (rdoc.uid !== this.user._id) throw new PermissionError(PERM.PERM_READ_RECORD_CODE);
|
||||||
} else if (rdoc.contest) {
|
} else if (rdoc.contest) {
|
||||||
const tdoc = await contest.get(domainId, rdoc.contest);
|
const tdoc = await contest.get(domainId, rdoc.contest);
|
||||||
|
|||||||
Reference in new issue
Block a user