diff options
author | Dan McGee <dan@archlinux.org> | 2012-03-23 23:48:43 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-03-24 01:54:40 +0100 |
commit | 6218ccc570c674bfaaf1c636382ac6f9adbf212b (patch) | |
tree | 736e5a3200d322ff5eb4019786891e198860c273 /main | |
parent | 7896779ff18b304f8246c24123b8cbf9b82ec5b0 (diff) | |
download | archweb-6218ccc570c674bfaaf1c636382ac6f9adbf212b.tar.gz archweb-6218ccc570c674bfaaf1c636382ac6f9adbf212b.tar.xz |
Use python hashlib directly
Django hashcompat is now deprecated.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r-- | main/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/utils.py b/main/utils.py index 81f689e..03441c1 100644 --- a/main/utils.py +++ b/main/utils.py @@ -4,9 +4,9 @@ except ImportError: import pickle from datetime import datetime +import hashlib from django.core.cache import cache -from django.utils.hashcompat import md5_constructor CACHE_TIMEOUT = 1800 INVALIDATE_TIMEOUT = 10 @@ -15,7 +15,7 @@ CACHE_LATEST_PREFIX = 'cache_latest_' def cache_function_key(func, args, kwargs): raw = [func.__name__, func.__module__, args, kwargs] pickled = pickle.dumps(raw, protocol=pickle.HIGHEST_PROTOCOL) - key = md5_constructor(pickled).hexdigest() + key = hashlib.md5(pickled).hexdigest() return 'cache_function.' + func.__name__ + '.' + key def cache_function(length): |