Commit ffd78ee1 authored by Jérome Perrin's avatar Jérome Perrin

core: support non initialized cache when viewing cache statistics

Maybe what's missing is an interaction to update cache internals with
updateCache when a cache is added, but that's enough to make TestXHTML
pass now.

fixup! core: workaround non initialized cache when viewing cache statistics
parent c46511f4
......@@ -9,7 +9,10 @@ cache_stats = context.getPortalObject().portal_caches.getCacheTotalMemorySize()
cache_factory_list_stats = cache_stats['stats']
cache_plugin_id = context.getId()
cache_factory_id = context.getParentValue().getId()
cache_plugin_stats = cache_factory_list_stats[cache_factory_id]
cache_plugin_stats = cache_factory_list_stats.get(
cache_factory_id,
{'cp_cache_keys_total_size': {},
'total': None})
cache_plugin_stats_data = cache_plugin_stats['cp_cache_keys_total_size']
if statistics_criteria == 'total':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment