core: record_main: allow allDomain option

This commit is contained in:
undefined committed 2021-08-17 16:22:51 +08:00
1 parent 8965a87910
commit 6385a7355b
7 files changed
+35 -18

No files matched your search

+2 -1
View File
@@ -4,7 +4,7 @@ import AdmZip from 'adm-zip';
import { Time } from '@hydrooj/utils/lib/utils';
import {
ContestNotLiveError, ValidationError, ProblemNotFoundError,
ContestNotAttendedError, PermissionError, BadRequestError, ContestNotFoundError, InvalidTokenError,
ContestNotAttendedError, PermissionError, BadRequestError, ContestNotFoundError, InvalidTokenError, RecordNotFoundError,
} from '../error';
import { ProblemDoc, Tdoc, User } from '../interface';
import paginate from '../lib/paginate';
@@ -363,6 +363,7 @@ export class ContestDetailProblemSubmitHandler extends ContestProblemHandler {
const pdomainId = typeof pid === 'string' ? pid.split(':')[0] : domainId;
const ppid = typeof pid === 'number' ? pid : +pid.split(':')[1];
const rdoc = await record.get(domainId, rid);
if (!rdoc) throw new RecordNotFoundError(domainId, rid);
if (!pretest) {
await Promise.all([
(this.tsdoc.journal || []).filter((i) => i.pid === pid).length ? Promise.resolve() : problem.inc(pdomainId, ppid, 'nSubmit', 1),