core&ui&judge: bug fixes and improvements

This commit is contained in:
undefined committed 2023-11-12 23:51:00 +08:00
1 parent 16992e057d
commit efde5b339f
4 files changed
+4 -2

No files matched your search

+1
View File
@@ -245,6 +245,7 @@ export class ContestDetailHandler extends Handler {
@param('tid', Types.ObjectId)
@param('code', Types.String, true)
async postAttend(domainId: string, tid: ObjectId, code = '') {
this.checkPerm(PERM.PERM_ATTEND_CONTEST);
if (contest.isDone(this.tdoc)) throw new ContestNotLiveError(tid);
if (this.tdoc._code && code !== this.tdoc._code) throw new InvalidTokenError('Contest Invitation', code);
await contest.attend(domainId, tid, this.user._id);