core: fix bugs (#702)

This commit is contained in:
panda authored and GitHub committed 2023-12-14 17:06:28 +08:00
1 parent 55b4e1aaf0
commit 453d9076b0
10 files changed
+18 -23

No files matched your search

+1
View File
@@ -473,6 +473,7 @@ export class ContestEditHandler extends Handler {
if (beginAtMoment.isSameOrAfter(endAt)) throw new ValidationError('duration');
const beginAt = beginAtMoment.toDate();
const lockAt = lock ? moment(endAt).add(-lock, 'minutes').toDate() : null;
if (lockAt && contestDuration) throw new ValidationError('lockAt', 'duration');
await problem.getList(domainId, pids, this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id, true);
if (tid) {
await contest.edit(domainId, tid, {