mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix bugs (#702)
This commit is contained in:
1 parent
55b4e1aaf0
commit
453d9076b0
10 files changed
+18
-23
No files matched your search
@@ -473,6 +473,7 @@ export class ContestEditHandler extends Handler {
|
||||
if (beginAtMoment.isSameOrAfter(endAt)) throw new ValidationError('duration');
|
||||
const beginAt = beginAtMoment.toDate();
|
||||
const lockAt = lock ? moment(endAt).add(-lock, 'minutes').toDate() : null;
|
||||
if (lockAt && contestDuration) throw new ValidationError('lockAt', 'duration');
|
||||
await problem.getList(domainId, pids, this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id, true);
|
||||
if (tid) {
|
||||
await contest.edit(domainId, tid, {
|
||||
|
||||
@@ -254,6 +254,7 @@ class SystemUserImportHandler extends SystemHandler {
|
||||
groups[data.group].push(email);
|
||||
}
|
||||
if (data.school) payload.school = data.school;
|
||||
if (data.studentId) payload.studentId = data.studentId;
|
||||
} catch (e) { }
|
||||
udocs.push({
|
||||
email, username, password, displayName, payload,
|
||||
|
||||
@@ -489,19 +489,12 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
||||
const langRange = (typeof this.pdoc.config === 'object' && this.pdoc.config.langs)
|
||||
? Object.fromEntries(this.pdoc.config.langs.map((i) => [i, setting.langs[i]?.display || i]))
|
||||
: setting.SETTINGS_BY_KEY.codeLang.range;
|
||||
this.response.body = {
|
||||
langRange,
|
||||
pdoc: this.pdoc,
|
||||
udoc: this.udoc,
|
||||
tdoc: this.tdoc,
|
||||
tsdoc: this.tsdoc,
|
||||
title: this.pdoc.title,
|
||||
page_name: this.tdoc
|
||||
? this.tdoc.rule === 'homework'
|
||||
? 'homework_detail_problem_submit'
|
||||
: 'contest_detail_problem_submit'
|
||||
: 'problem_submit',
|
||||
};
|
||||
this.response.body.langRange = langRange;
|
||||
this.response.body.page_name = this.tdoc
|
||||
? this.tdoc.rule === 'homework'
|
||||
? 'homework_detail_problem_submit'
|
||||
: 'contest_detail_problem_submit'
|
||||
: 'problem_submit';
|
||||
}
|
||||
|
||||
@param('lang', Types.Name)
|
||||
|
||||
Reference in new issue
Block a user