From 9d42119a0989d6edfba53c5ba0e29bd71305beb8 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Tue, 21 Feb 2023 14:13:37 -0600 Subject: [PATCH] Fix hash --- judge/ml/collab_filter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/judge/ml/collab_filter.py b/judge/ml/collab_filter.py index 512c747..f06637f 100644 --- a/judge/ml/collab_filter.py +++ b/judge/ml/collab_filter.py @@ -41,7 +41,7 @@ class CollabFilter: def user_recommendations(self, user, problems, measure=DOT, limit=None, **kwargs): uid = user.id - problems_hash = hashlib.sha1(str(problems).encode()).hexdigest() + problems_hash = hashlib.sha1(str(list(problems)).encode()).hexdigest() cache_key = ":".join(map(str, [self.name, uid, measure, limit, problems_hash])) value = cache.get(cache_key) if value: