Add condition for related problems

This commit is contained in:
cuom1999 2023-01-27 19:16:48 -06:00
parent ca13ee4e8d
commit e0ce058989

View file

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