From e0ce0589898defc913eb91454881098e90d829c7 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Fri, 27 Jan 2023 19:16:48 -0600 Subject: [PATCH] Add condition for related problems --- judge/utils/problems.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge/utils/problems.py b/judge/utils/problems.py index 46c846b..f6b9cde 100644 --- a/judge/utils/problems.py +++ b/judge/utils/problems.py @@ -236,7 +236,7 @@ def hot_problems(duration, limit): def get_related_problems(profile, problem, limit=8): - if not profile: + if not profile or not settings.ML_OUTPUT_PATH: return None problemset = Problem.get_visible_problems(profile.user).values_list("id", flat=True) problemset = problemset.exclude(id__in=user_completed_ids(profile))