Commits

Josh VanderLinden committed fc6a1ae

Fixing a potential problem with caching in memcached

  • Participants
  • Parent commits fc4f442

Comments (0)

Files changed (2)

File articles/__init__.py

-__version__ = '2.4.1'
+__version__ = '2.4.2'
 
 from articles.directives import *
 try:

File articles/models.py

-from base64 import encodestring
+from hashlib import sha1
 from datetime import datetime
 import logging
 import mimetypes
         for link in LINK_RE.finditer(self.rendered_content):
             url = link.group(1)
             log.debug('Do we have a title for "%s"?' % (url,))
-            key = 'href_title_' + encodestring(url).strip()
+            key = 'href_title_' + sha1(url).hexdigest()
 
             # look in the cache for the link target's title
             title = cache.get(key)