# HG changeset patch # User Ludovic Chabant # Date 1437456339 25200 # Node ID 3b6cbadd0c64298c011fa76a61a925754bcbbd09 # Parent 5ee62af2a4e327b6ad59eb047469795014d68998 themes: Add config paths to the cache key. This makes PieCrust re-process the configuration when the user changes which theme is currently applied to the site. diff -r 5ee62af2a4e3 -r 3b6cbadd0c64 piecrust/app.py --- a/piecrust/app.py Mon Jul 20 22:22:38 2015 -0700 +++ b/piecrust/app.py Mon Jul 20 22:25:39 2015 -0700 @@ -63,8 +63,11 @@ return path_times = [os.path.getmtime(p) for p in self.paths] - cache_key = hashlib.md5(("version=%s&cache=%d" % ( - APP_VERSION, CACHE_VERSION)).encode('utf8')).hexdigest() + cache_key_hash = hashlib.md5(("version=%s&cache=%d" % ( + APP_VERSION, CACHE_VERSION)).encode('utf8')) + for p in self.paths: + cache_key_hash.update(("&path=%s" % p).encode('utf8')) + cache_key = cache_key_hash.hexdigest() if self.cache.isValid('config.json', path_times): logger.debug("Loading configuration from cache...")