core: fix isContest

This commit is contained in:
undefined committed 2021-12-02 23:21:53 +08:00
1 parent 71002a8257
commit 564b603fe9
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -416,7 +416,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
}
if (pretest && !['default', 'fileio'].includes(this.response.body.pdoc.config?.type)) throw new BadRequestError('unable to run pretest');
await this.limitRate('add_record', 60, system.get('limit.submission'));
const rid = await record.add(domainId, this.pdoc.docId, this.user._id, lang, code, true, pretest ? input : tid, !pretest);
const rid = await record.add(domainId, this.pdoc.docId, this.user._id, lang, code, true, pretest ? input : tid, tid && !pretest);
const rdoc = await record.get(domainId, rid);
if (!pretest) {
await Promise.all([
+1 -1
View File
@@ -103,7 +103,7 @@ class RecordModel {
static async add(
domainId: string, pid: number, uid: number,
lang: string, code: string, addTask: boolean, tidOrInput?: ObjectID | string, isContest?: boolean,
lang: string, code: string, addTask: boolean, tidOrInput?: ObjectID | string, isContest = false,
) {
const data: RecordDoc = {
status: STATUS.STATUS_WAITING,