mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix problem_copy testdata link
This commit is contained in:
1 parent
f2b8030bb2
commit
f9918128a9
2 files changed
+2
-1
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.10.4",
|
"version": "3.10.5",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -558,6 +558,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
|
|||||||
@post('type', Types.Range(['testdata', 'additional_file']), true)
|
@post('type', Types.Range(['testdata', 'additional_file']), true)
|
||||||
async postGetLinks(domainId: string, files: Set<string>, type = 'testdata') {
|
async postGetLinks(domainId: string, files: Set<string>, type = 'testdata') {
|
||||||
if (type === 'testdata' && !this.user.own(this.pdoc)) {
|
if (type === 'testdata' && !this.user.own(this.pdoc)) {
|
||||||
|
if (this.pdoc.reference) throw new BadRequestError('Cannot download testdata.');
|
||||||
if (!this.user.hasPriv(PRIV.PRIV_READ_PROBLEM_DATA)) this.checkPerm(PERM.PERM_READ_PROBLEM_DATA);
|
if (!this.user.hasPriv(PRIV.PRIV_READ_PROBLEM_DATA)) this.checkPerm(PERM.PERM_READ_PROBLEM_DATA);
|
||||||
if (this.tdoc && !contest.isDone(this.tdoc)) throw new ContestNotEndedError(this.tdoc.domainId, this.tdoc.docId);
|
if (this.tdoc && !contest.isDone(this.tdoc)) throw new ContestNotEndedError(this.tdoc.domainId, this.tdoc.docId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user