core: fix problem edit without pid change

This commit is contained in:
undefined committed 2021-03-07 21:34:41 +08:00
1 parent dcf949dc7a
commit 006f969de6
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.20.5",
"version": "2.20.6",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+1 -1
View File
@@ -328,7 +328,7 @@ export class ProblemEditHandler extends ProblemManageHandler {
try {
content = JSON.parse(content);
} catch { /* Ignore */ }
if (await problem.get(domainId, newPid)) throw new BadRequestError('new pid exists');
if (newPid !== this.pdoc.pid && await problem.get(domainId, newPid)) throw new BadRequestError('new pid exists');
const $update: Partial<Pdoc> = {
title, content, pid: newPid, hidden, tag,
};