From c9cd84c54cd4b664e75ef637a556511ecd9d0335 Mon Sep 17 00:00:00 2001 From: Menci Date: Wed, 21 Jun 2017 23:06:25 +0800 Subject: [PATCH] Fix can't see submission after contest --- models/judge_state.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/models/judge_state.js b/models/judge_state.js index 546123d..a3e33b4 100644 --- a/models/judge_state.js +++ b/models/judge_state.js @@ -105,7 +105,12 @@ class JudgeState extends Model { if (user && user.id === this.problem.user_id) return true; else if (this.type === 0 || this.type == 2) return this.problem.is_public || (user && (await user.hasPrivilege('manage_problem'))); else if (this.type === 1) { - return user && (user.is_admin || user.id === this.user_id); + let contest = await Contest.fromID(this.type_info); + if (await contest.isRunning()) { + return (user && this.user_id === user.id) || (user && user.is_admin); + } else { + return true; + } } }