Commits

Marcin Kuzminski  committed cd1c21a

Fixed problems with unicode cache keys in celery

  • Participants
  • Parent commits 747bc42
  • Branches default

Comments (0)

Files changed (2)

File rhodecode/lib/__init__.py

     :rtype: str
     :returns: str object
     """
+    
+    if not isinstance(unicode_, basestring):
+        return str(unicode_)
 
     if isinstance(unicode_, str):
         return unicode_

File rhodecode/lib/celerylib/__init__.py

 
 from vcs.utils.lazy import LazyProperty
 
-from rhodecode.lib import str2bool
+from rhodecode.lib import str2bool, safe_str
 from rhodecode.lib.pidlock import DaemonLock, LockHeld
 
 from celery.messaging import establish_connection
     func_name = str(func.__name__) if hasattr(func, '__name__') else str(func)
 
     lockkey = 'task_%s.lock' % \
-        md5(func_name + '-' + '-'.join(map(str, params))).hexdigest()
+        md5(func_name + '-' + '-'.join(map(safe_str, params))).hexdigest()
     return lockkey