Commit 26e598cf authored by Jérome Perrin's avatar Jérome Perrin

Prevent infinite loop in _aq_dynamic if path is not retrieved from database


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6069 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 996704f0
......@@ -26,9 +26,17 @@ class ZSQLBrain(Acquisition.Implicit):
security = ClassSecurityInfo()
security.declareObjectPublic()
def __init__(self) :
"""Init the brain and make sure path was retrieved from the RDB"""
if 'path' not in dir(self) and 'PATH' not in dir(self):
raise ValueError, "Unable to use ZSQLBrain if ZSQL Method does "\
"not retrieves the `path` column from catalog table."
def _aq_dynamic(self, name):
"""Acquire an attribute from a real object.
"""
if name.startswith('__') :
return None
o = self.getObject()
return getattr(o, name, None)
......
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