This commit is contained in:
cuom1999 2023-02-21 14:13:37 -06:00
parent 227946db8c
commit 9d42119a09

View file

@ -41,7 +41,7 @@ class CollabFilter:
def user_recommendations(self, user, problems, measure=DOT, limit=None, **kwargs): def user_recommendations(self, user, problems, measure=DOT, limit=None, **kwargs):
uid = user.id 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])) cache_key = ":".join(map(str, [self.name, uid, measure, limit, problems_hash]))
value = cache.get(cache_key) value = cache.get(cache_key)
if value: if value: