Fix hash
This commit is contained in:
parent
227946db8c
commit
9d42119a09
1 changed files with 1 additions and 1 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue