Commit 660ae35a authored by Vincent Pelletier's avatar Vincent Pelletier

Remove redundant code.

_aq_dynamic will be called after getattr fails.
parent 4a3ced3e
......@@ -922,10 +922,9 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
Automatic related key generation.
Will generate z_related_[base_category_id] if possible
"""
aq_base_name = getattr(aq_base(self), name, None)
if aq_base_name == None:
if (name.startswith(DYNAMIC_METHOD_NAME) and \
(not name.endswith(ZOPE_SECURITY_SUFFIX))):
result = None
if name.startswith(DYNAMIC_METHOD_NAME) and \
not name.endswith(ZOPE_SECURITY_SUFFIX):
if name.endswith(RELATED_DYNAMIC_METHOD_NAME):
if name.startswith(STRICT_DYNAMIC_METHOD_NAME):
......@@ -944,10 +943,8 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
method = RelatedBaseCategory(base_category_id)
setattr(self.__class__, name, method)
return getattr(self, name)
else:
return aq_base_name
return aq_base_name
result = getattr(self, name)
return result
def _searchAndActivate(self, method_id, method_args=(), method_kw={},
activate_kw={}, min_uid=None, **kw):
......
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