core: small enhancements

This commit is contained in:
undefined committed 2022-11-08 00:25:04 +08:00
1 parent 50b838d21d
commit d7908aaff6
5 files changed
+24 -8

No files matched your search

+2 -1
View File
@@ -2,7 +2,7 @@
import decodeHTML from 'decode-html';
import xml2js from 'xml2js';
import {
_, AdmZip, buildContent, ContentNode, Context, FileTooLargeError, fs,
_, AdmZip, BadRequestError, buildContent, ContentNode, Context, FileTooLargeError, fs,
Handler, PERM, ProblemConfigFile, ProblemModel, SolutionModel, ValidationError,
} from 'hydrooj';
@@ -12,6 +12,7 @@ class FpsProblemImportHandler extends Handler {
}
async run(domainId: string, result: any) {
if (!result?.fps) throw new BadRequestError('Selected file is not a valid FPS problemset.');
for (const p of result.fps.item) {
const content: ContentNode[] = [];
if (p.description?.[0]) {