Commit 212335aa authored by Aurel's avatar Aurel

do not acquire 'categories' property


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11570 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a0e4f39f
...@@ -743,7 +743,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -743,7 +743,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
if type(spec) is type('a'): if type(spec) is type('a'):
spec = [spec] spec = [spec]
# Filter categories # Filter categories
if hasattr(context, 'categories'): if hasattr(aq_base(context), 'categories'):
for category_url in self._getCategoryList(context): for category_url in self._getCategoryList(context):
try: try:
index = category_url.index('/') index = category_url.index('/')
...@@ -869,7 +869,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -869,7 +869,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
result = self.getSingleCategoryMembershipList( context, base_category, base=base, result = self.getSingleCategoryMembershipList( context, base_category, base=base,
spec=spec, filter=filter, **kw ) # Not acquired because this is the first try spec=spec, filter=filter, **kw ) # Not acquired because this is the first try
# to get a local defined category # to get a local defined category
base_category_value = self.getCategoryValue(base_category) base_category_value = self.getCategoryValue(base_category)
#LOG("base_category_value",0,str(base_category_value)) #LOG("base_category_value",0,str(base_category_value))
#LOG("result",0,str(result)) #LOG("result",0,str(result))
...@@ -1139,7 +1139,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -1139,7 +1139,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
security.declareProtected( Permissions.AccessContentsInformation, '_getCategoryList' ) security.declareProtected( Permissions.AccessContentsInformation, '_getCategoryList' )
def _getCategoryList(self, context): def _getCategoryList(self, context):
if hasattr(context, 'categories'): if hasattr(aq_base(context), 'categories'):
if type(context.categories) == type((1,)): if type(context.categories) == type((1,)):
result = list(context.categories) result = list(context.categories)
elif type(context.categories) == type([]): elif type(context.categories) == type([]):
......
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