mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: delete task when deleting contest
This commit is contained in:
1 parent
7cdd542ed1
commit
c07bf9a845
2 files changed
+4
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.1.37",
|
||||
"version": "3.1.38",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -116,6 +116,9 @@ export class ContestDetailHandler extends Handler {
|
||||
const tdoc = await contest.get(domainId, tid);
|
||||
if (!this.user.own(tdoc)) this.checkPerm(PERM.PERM_EDIT_CONTEST);
|
||||
await contest.del(domainId, tid);
|
||||
await TaskModel.deleteMany({
|
||||
type: 'schedule', subType: 'contest.problemHide', domainId, tid,
|
||||
});
|
||||
this.response.redirect = this.url('contest_main');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user