core: lang: add disabled option

This commit is contained in:
undefined committed 2023-01-30 07:01:32 +08:00
1 parent 2cd89d7258
commit 88461a78cd
3 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -507,7 +507,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
if (typeof config === 'string' || config === null) throw new ProblemConfigError();
if (config.type === 'objective') {
lang = '_';
} else if (config.langs && !config.langs.includes(lang)) {
} else if ((config.langs && !config.langs.includes(lang)) || setting.langs[lang].disabled) {
throw new ProblemNotAllowLanguageError();
}
if (pretest) {