diff --git a/judge/views/problem.py b/judge/views/problem.py index 741b8c9..d85f5ad 100644 --- a/judge/views/problem.py +++ b/judge/views/problem.py @@ -949,6 +949,12 @@ class LanguageTemplateAjax(View): class RandomProblem(ProblemList): def get(self, request, *args, **kwargs): 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: raise Http404()