Add superuser required to download AC submissions
This commit is contained in:
parent
7c8cd4632b
commit
13eb433086
1 changed files with 3 additions and 0 deletions
|
@ -681,6 +681,9 @@ class ProblemClone(ProblemMixin, PermissionRequiredMixin, TitleMixin, SingleObje
|
||||||
|
|
||||||
|
|
||||||
def download_submissions(request, problem):
|
def download_submissions(request, problem):
|
||||||
|
if not request.user.is_superuser:
|
||||||
|
raise Http404
|
||||||
|
|
||||||
submissions = Submission.objects.filter(problem__code=problem, result='AC')
|
submissions = Submission.objects.filter(problem__code=problem, result='AC')
|
||||||
|
|
||||||
with tempfile.SpooledTemporaryFile() as tmp:
|
with tempfile.SpooledTemporaryFile() as tmp:
|
||||||
|
|
Loading…
Reference in a new issue