Add validation for random problem
This commit is contained in:
parent
5d79374b92
commit
ee17bc0778
1 changed files with 6 additions and 0 deletions
|
@ -949,6 +949,12 @@ class LanguageTemplateAjax(View):
|
||||||
class RandomProblem(ProblemList):
|
class RandomProblem(ProblemList):
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
self.setup_problem_list(request)
|
self.setup_problem_list(request)
|
||||||
|
|
||||||
|
try:
|
||||||
|
return super().get(request, *args, **kwargs)
|
||||||
|
except ProgrammingError as e:
|
||||||
|
return generic_message(request, "FTS syntax error", e.args[1], status=400)
|
||||||
|
|
||||||
if self.in_contest:
|
if self.in_contest:
|
||||||
raise Http404()
|
raise Http404()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue