core: delete task when deleting contest

This commit is contained in:
undefined committed 2021-11-27 15:18:32 +08:00
1 parent 7cdd542ed1
commit c07bf9a845
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "3.1.37", "version": "3.1.38",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+3
View File
@@ -116,6 +116,9 @@ export class ContestDetailHandler extends Handler {
const tdoc = await contest.get(domainId, tid); const tdoc = await contest.get(domainId, tid);
if (!this.user.own(tdoc)) this.checkPerm(PERM.PERM_EDIT_CONTEST); if (!this.user.own(tdoc)) this.checkPerm(PERM.PERM_EDIT_CONTEST);
await contest.del(domainId, tid); await contest.del(domainId, tid);
await TaskModel.deleteMany({
type: 'schedule', subType: 'contest.problemHide', domainId, tid,
});
this.response.redirect = this.url('contest_main'); this.response.redirect = this.url('contest_main');
} }
} }