Allow contest host to view submissions
This commit is contained in:
parent
f095729cb6
commit
1dfc6d312d
2 changed files with 9 additions and 0 deletions
|
@ -77,6 +77,10 @@ class SubmissionDetailBase(LoginRequiredMixin, TitleMixin, SubmissionMixin, Deta
|
|||
if Submission.objects.filter(user_id=profile.id, result='AC', problem_id=problem.id,
|
||||
points=problem.points).exists():
|
||||
return submission
|
||||
if (hasattr(submission, 'contest') and
|
||||
submission.contest.participation.contest.is_editable_by(self.request.user)):
|
||||
return submission
|
||||
|
||||
raise PermissionDenied()
|
||||
|
||||
def get_title(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue