diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index c94ec990d..c9c9102a8 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -822,7 +822,7 @@ export class ProblemSolutionHandler extends ProblemDetailHandler { async get(domainId: string, page = 1, tid?: ObjectId, sid?: ObjectId) { if (tid) throw new PermissionError(PERM.PERM_VIEW_PROBLEM_SOLUTION); this.response.template = 'problem_solution.html'; - const accepted = this.tsdoc?.status === STATUS.STATUS_ACCEPTED; + const accepted = this.psdoc?.status === STATUS.STATUS_ACCEPTED; if (!accepted || !this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_SOLUTION_ACCEPT)) { this.checkPerm(PERM.PERM_VIEW_PROBLEM_SOLUTION); } @@ -933,7 +933,7 @@ export class ProblemSolutionRawHandler extends ProblemDetailHandler { @param('tid', Types.ObjectId, true) async get(domainId: string, psid: ObjectId, psrid?: ObjectId, tid?: ObjectId) { if (tid) throw new PermissionError(PERM.PERM_VIEW_PROBLEM_SOLUTION); - const accepted = this.tsdoc?.status === STATUS.STATUS_ACCEPTED; + const accepted = this.psdoc?.status === STATUS.STATUS_ACCEPTED; if (!accepted || !this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_SOLUTION_ACCEPT)) { this.checkPerm(PERM.PERM_VIEW_PROBLEM_SOLUTION); }