Add superuser required to download AC submissions

This commit is contained in:
cuom1999 2020-07-30 23:44:08 -05:00
parent 7c8cd4632b
commit 13eb433086

View file

@ -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: