use files hack for rejudge

This commit is contained in:
panda authored and undefined committed 2022-09-06 13:02:46 +08:00
1 parent bb7ee5cbf9
commit 9621f654c5
5 files changed
+13 -9

No files matched your search

+6 -4
View File
@@ -171,11 +171,13 @@ class RecordDetailHandler extends Handler {
}
@param('rid', Types.ObjectID)
async postRejudge(domainId: string, rid: ObjectID) {
async post() {
this.checkPerm(PERM.PERM_REJUDGE);
if ([STATUS.STATUS_HACK_SUCCESSFUL, STATUS.STATUS_HACK_UNSUCCESSFUL].includes(this.rdoc.status)) {
throw new ForbiddenError('Cannot rejudge a hack record.');
}
if (this.rdoc.files?.hack) throw new ForbiddenError('Cannot rejudge a hack record.');
}
@param('rid', Types.ObjectID)
async postRejudge(domainId: string, rid: ObjectID) {
const priority = await record.submissionPriority(this.user._id, -20);
const isContest = this.rdoc.contest && this.rdoc.contest.toString() !== '000000000000000000000000';
await record.reset(domainId, rid, true);