mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: unset record contest attr when deleting contest
This commit is contained in:
1 parent
375a06a98d
commit
eeff671c3a
2 files changed
+2
-1
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.10.3",
|
"version": "3.10.4",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ 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 record.updateMulti(domainId, { domainId, contest: tid }, undefined, undefined, { contest: '' });
|
||||||
await TaskModel.deleteMany({
|
await TaskModel.deleteMany({
|
||||||
type: 'schedule', subType: 'contest', domainId, tid,
|
type: 'schedule', subType: 'contest', domainId, tid,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user