src/hdalab/utils.py
changeset 345 7bc38c7d6cf9
parent 319 fef4317b915f
child 462 df8b3b49e81c
--- a/src/hdalab/utils.py	Tue Sep 30 12:31:48 2014 +0200
+++ b/src/hdalab/utils.py	Sat Nov 01 17:42:33 2014 +0100
@@ -6,7 +6,7 @@
 '''
 from django.core.cache import cache
 from django.utils.encoding import smart_str
-import md5
+import hashlib
 import re
 
 import logging
@@ -17,7 +17,7 @@
     cache_key = re.sub(r'\s+', '-', key)
     cache_key = smart_str(cache_key)
     if len(cache_key) > (250-(2+len(cache.key_prefix)+len(str(cache.version)))-33):
-        cache_key = cache_key[:(250-(2+len(cache.key_prefix)+len(str(cache.version)))-33)] + '-' + md5.new(cache_key).hexdigest()
+        cache_key = cache_key[:(250-(2+len(cache.key_prefix)+len(str(cache.version)))-33)] + '-' + hashlib.md5(cache_key).hexdigest()
     return cache_key
         
         
\ No newline at end of file