Changeset - d4b1b40b41ac
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2015-03-11 00:24:25
madski@unity3d.com
db: fix beaker caching key of (invalid) unicode email addresses

It would crash with UnicodeDecodeError in beaker when trying to retrieve the
user by email.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/caching_query.py
Show inline comments
 
@@ -167,25 +167,25 @@ def _namespace_from_query(namespace, que
 

	
 
    return namespace
 

	
 

	
 
def _set_cache_parameters(query, region, namespace, cache_key):
 

	
 
    if hasattr(query, '_cache_parameters'):
 
        region, namespace, cache_key = query._cache_parameters
 
        raise ValueError("This query is already configured "
 
                        "for region %r namespace %r" %
 
                        (region, namespace)
 
                    )
 
    query._cache_parameters = region, namespace, cache_key
 
    query._cache_parameters = region, safe_str(namespace), cache_key
 

	
 

	
 
class FromCache(MapperOption):
 
    """Specifies that a Query should load results from a cache."""
 

	
 
    propagate_to_loaders = False
 

	
 
    def __init__(self, region, namespace, cache_key=None):
 
        """Construct a new FromCache.
 

	
 
        :param region: the cache region.  Should be a
 
        region configured in the Beaker CacheManager.
0 comments (0 inline, 0 general)