Only wrap if there's __of__

parent 7935b7fa
...@@ -65,7 +65,8 @@ class ViewletManagerBase(origManagerBase, Acquisition.Explicit): ...@@ -65,7 +65,8 @@ class ViewletManagerBase(origManagerBase, Acquisition.Explicit):
# the object has a real context from which to determine owner # the object has a real context from which to determine owner
# security. # security.
for name, viewlet in viewlets: for name, viewlet in viewlets:
viewlet = viewlet.__of__(viewlet.context) if getattr(viewlet, '__of__', None) is not None:
viewlet = viewlet.__of__(viewlet.__parent__)
if guarded_hasattr(viewlet, 'render'): if guarded_hasattr(viewlet, 'render'):
results.append((name, viewlet)) results.append((name, viewlet))
return results return results
......
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