Commit 6236f60e authored by Jean-Paul Smets's avatar Jean-Paul Smets

Improved support of layout property acquisition.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25567 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 52b6031d
......@@ -126,13 +126,16 @@ class WebSection(Domain, PermanentURLMixIn):
"""
section = aq_inner(self)
while section.getPortalType() in ('Web Section', 'Web Site'):
if d is MARKER:
result = section.getProperty(key)
else:
result = section.getProperty(key, d)
if result:
result = section.getProperty(key, MARKER)
if result is not MARKER and result:
return result
section = section.aq_parent
# No property was defined on children neither on web site
# If a default is provided, return it
# else raise
if d is not MARKER:
return d
raise AttributeError('Web Section %s has no layout property %s' % (self.getUrl(), key))
security.declareProtected(Permissions.AccessContentsInformation, 'getWebSectionValue')
def getWebSectionValue(self):
......
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