mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix contest_problem_submit
This commit is contained in:
1 parent
a02c859d04
commit
8d0ae4bead
4 files changed
+4
-4
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.26.27",
|
"version": "2.26.28",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ class ContestDetailProblemSubmitHandler extends ContestProblemHandler {
|
|||||||
@param('lang', Types.Name)
|
@param('lang', Types.Name)
|
||||||
@param('code', Types.Content)
|
@param('code', Types.Content)
|
||||||
async post(domainId: string, tid: ObjectID, lang: string, code: string) {
|
async post(domainId: string, tid: ObjectID, lang: string, code: string) {
|
||||||
if (this.response.body.pdoc.config.langs && !this.response.body.pdoc.config.langs.includes('lang')) {
|
if (this.response.body.pdoc.config?.langs && !this.response.body.pdoc.config.langs.includes(lang)) {
|
||||||
throw new BadRequestError('Language not allowed.');
|
throw new BadRequestError('Language not allowed.');
|
||||||
}
|
}
|
||||||
await this.limitRate('add_record', 60, 10);
|
await this.limitRate('add_record', 60, 10);
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ class HomeworkDetailProblemSubmitHandler extends HomeworkDetailProblemHandler {
|
|||||||
@param('code', Types.Content)
|
@param('code', Types.Content)
|
||||||
@param('lang', Types.Name)
|
@param('lang', Types.Name)
|
||||||
async post(domainId: string, tid: ObjectID, pid: number, code: string, lang: string) {
|
async post(domainId: string, tid: ObjectID, pid: number, code: string, lang: string) {
|
||||||
if (this.response.body.pdoc.config?.langs && !this.response.body.pdoc.config.langs.includes('lang')) {
|
if (this.response.body.pdoc.config?.langs && !this.response.body.pdoc.config.langs.includes(lang)) {
|
||||||
throw new BadRequestError('Language not allowed.');
|
throw new BadRequestError('Language not allowed.');
|
||||||
}
|
}
|
||||||
await this.limitRate('add_record', 60, 5);
|
await this.limitRate('add_record', 60, 5);
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
|||||||
@param('lang', Types.Name)
|
@param('lang', Types.Name)
|
||||||
@param('code', Types.Content)
|
@param('code', Types.Content)
|
||||||
async post(domainId: string, lang: string, code: string) {
|
async post(domainId: string, lang: string, code: string) {
|
||||||
if (this.response.body.pdoc.config?.langs && !this.response.body.pdoc.config.langs.includes('lang')) {
|
if (this.response.body.pdoc.config?.langs && !this.response.body.pdoc.config.langs.includes(lang)) {
|
||||||
throw new BadRequestError('Language not allowed.');
|
throw new BadRequestError('Language not allowed.');
|
||||||
}
|
}
|
||||||
await this.limitRate('add_record', 60, 5);
|
await this.limitRate('add_record', 60, 5);
|
||||||
|
|||||||
Reference in new issue
Block a user