--- a/src/pyams_default_theme/features/header/skin/__init__.py Fri Feb 01 18:33:44 2019 +0100
+++ b/src/pyams_default_theme/features/header/skin/__init__.py Fri Feb 01 18:37:24 2019 +0100
@@ -88,19 +88,20 @@
return get_reference_target(self.settings.search_target, request=self.request)
def render(self):
+ request = self.request
+ context = request.context
# root condition applies only when not displaying a shared content
- if ISiteRoot.providedBy(self.request.context) and \
- (self.request.display_context is None) and \
+ if ISiteRoot.providedBy(context) and \
not self.settings.can_apply_on_root:
return ''
# don't use cache in preview mode
- preview_mode = self.request.annotations.get(PREVIEW_MODE, False)
+ preview_mode = request.annotations.get(PREVIEW_MODE, False)
if preview_mode:
return super(BaseHeaderRenderer, self).render()
else:
portlets_cache = get_cache(PORTLETS_CACHE_REGION, PORTLETS_CACHE_NAME)
cache_key = self.cache_key
- if self.context is not self.request.context: # display shared content
+ if context is not self.context: # display shared content
cache_key = '{0}::shared'.format(cache_key)
try:
result = portlets_cache.get_value(cache_key)