use request "display_context" property instead of using annotations in header renderer
authorThierry Florac <tflorac@ulthar.net>
Wed, 30 Jan 2019 18:29:02 +0100
changeset 412 9fdfc9392edc
parent 411 182295d018f7
child 413 ca5dc86bf65f
use request "display_context" property instead of using annotations in header renderer
src/pyams_default_theme/features/header/skin/__init__.py
--- a/src/pyams_default_theme/features/header/skin/__init__.py	Wed Jan 30 18:27:13 2019 +0100
+++ b/src/pyams_default_theme/features/header/skin/__init__.py	Wed Jan 30 18:29:02 2019 +0100
@@ -37,7 +37,6 @@
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config
 from pyams_utils.interfaces import ICacheKeyValue
-from pyams_utils.interfaces.url import DISPLAY_CONTEXT
 from pyams_utils.traversing import get_parent
 
 
@@ -91,7 +90,7 @@
     def render(self):
         # root condition applies only when not displaying a shared content
         if ISiteRoot.providedBy(self.request.context) and \
-                (self.request.annotations.get(DISPLAY_CONTEXT) is None) and \
+                (self.request.display_context is None) and \
                 not self.settings.can_apply_on_root:
             return ''
         # don't use cache in preview mode