Updated OID traverser
authorThierry Florac <tflorac@ulthar.net>
Fri, 01 Feb 2019 18:33:44 +0100
changeset 413 ca5dc86bf65f
parent 412 9fdfc9392edc
child 414 89a7df9f7c79
Updated OID traverser
src/pyams_default_theme/shared/common/oid.py
--- a/src/pyams_default_theme/shared/common/oid.py	Wed Jan 30 18:29:02 2019 +0100
+++ b/src/pyams_default_theme/shared/common/oid.py	Fri Feb 01 18:33:44 2019 +0100
@@ -38,6 +38,8 @@
     """
 
     def traverse(self, name, furtherpath=None):
+        context = self.context
+        request = self.request
         if not name:
             raise NotFound()
         oid = name.split('::')[0]
@@ -52,9 +54,10 @@
                     versions = versions.get_versions(workflow.visible_states, sort=True)
                     if versions:
                         target = versions[-1]
-        if (target is not None) and not IWorkflowPublicationInfo(target).is_visible(self.request):
+        if (target is not None) and not IWorkflowPublicationInfo(target).is_visible(request):
             target = None
         if target is not None:
-            self.request.annotations[DISPLAY_CONTEXT] = self.context
+            request.annotations[DISPLAY_CONTEXT] = context
+            request.context = target
             return target
         raise NotFound()