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): ...@@ -126,13 +126,16 @@ class WebSection(Domain, PermanentURLMixIn):
""" """
section = aq_inner(self) section = aq_inner(self)
while section.getPortalType() in ('Web Section', 'Web Site'): while section.getPortalType() in ('Web Section', 'Web Site'):
if d is MARKER: result = section.getProperty(key, MARKER)
result = section.getProperty(key) if result is not MARKER and result:
else:
result = section.getProperty(key, d)
if result:
return result return result
section = section.aq_parent 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') security.declareProtected(Permissions.AccessContentsInformation, 'getWebSectionValue')
def getWebSectionValue(self): 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