core: problem.import: add delSource option

This commit is contained in:
undefined committed 2024-08-20 05:39:13 +08:00
1 parent 87ec582546
commit 1b5451afad
3 files changed
+28 -13

No files matched your search

+2 -2
View File
@@ -729,7 +729,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
if ((this.pdoc.data?.length || 0)
+ (this.pdoc.additional_file?.length || 0)
+ files.length
>= system.get('limit.problem_files_max')) {
>= this.ctx.setting.get('limit.problem_files_max')) {
throw new FileLimitExceededError('count');
}
const size = Math.sum(
@@ -737,7 +737,7 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
(this.pdoc.additional_file || []).map((i) => i.size),
files.map((i) => i.size),
);
if (size >= system.get('limit.problem_files_max_size')) {
if (size >= this.ctx.setting.get('limit.problem_files_max_size')) {
throw new FileLimitExceededError('size');
}
}