X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/blobdiff_plain/eeafdfccb63314d85802f3064b6fb904375bda03..29f2eef0ba05968f84c3afad30e1fa105fc56ed3:/sommitrealweird/bpcms/context_processors.py diff --git a/sommitrealweird/bpcms/context_processors.py b/sommitrealweird/bpcms/context_processors.py index e92e8ce..1d254b1 100644 --- a/sommitrealweird/bpcms/context_processors.py +++ b/sommitrealweird/bpcms/context_processors.py @@ -44,9 +44,16 @@ def content_submenu(request): # find where we are in the tree first folderpath = request.path folderpath = re.sub(u'^%s' %(settings.BPCMS_ROOT), '', folderpath) + # right - that should be any prefix got rid of, now traverse the tree till # we've got something - menu_items = cache.get('bpcms_contentmenu_%s' %(folderpath)) + try: + menu_items = cache.get('bpcms_contentmenu_%s' %(folderpath)) + except: + # fail on cache engine or bad key, ignore + return { + 'content_submenu': {}, + } if not menu_items: folder = None