Commit 8b8c0a85 authored by David Glick's avatar David Glick

fix regression in traversing to 'macros' on template-based browser views,...

fix regression in traversing to 'macros' on template-based browser views, which crept in somewhere on the way to 2.12
parent 548c8b32
......@@ -20,6 +20,8 @@ Features Added
Bugs Fixed
++++++++++
- Restore ability to traverse to 'macros' on template-based browser views.
- Protect ZCTextIndex's clear method against storing Acquisition wrappers.
- LP #195761: fixed ZMI XML export / import and restored it to the UI.
......
......@@ -421,6 +421,8 @@ class ViewMixinForTemplates(BrowserView):
raise NotFound(self, name, request)
def __getitem__(self, name):
if name == 'macros':
return self.index.macros
return self.index.macros[name]
def __call__(self, *args, **kw):
......
......@@ -41,6 +41,12 @@ class ViewMixinForTemplatesTests(unittest.TestCase):
index.macros = {}
index.macros['aaa'] = aaa = object()
self.failUnless(view['aaa'] is aaa)
def test__getitem__gives_shortcut_to_index_macros(self):
view = self._makeOne()
view.index = index = DummyTemplate()
index.macros = {}
self.failUnless(view['macros'] is index.macros)
def test___call___no_args_no_kw(self):
view = self._makeOne()
......
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