Commit c0fc4836 authored by Alexandre Boeglin's avatar Alexandre Boeglin

* don't force conversion of uids to int

* call accessors instead of using object.uid


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7118 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a3077d9d
...@@ -103,8 +103,8 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool): ...@@ -103,8 +103,8 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
my_base_category = base_category my_base_category = base_category
bo = getattr(self, my_base_category, None) bo = getattr(self, my_base_category, None)
if bo is not None: if bo is not None:
bo_uid = int(bo.getUid()) bo_uid = bo.getUid()
uid_dict[(int(o.uid), bo_uid, 1)] = 1 # Strict membership uid_dict[(o.getUid(), bo_uid, 1)] = 1 # Strict membership
if o.meta_type == 'ERP5 Category' or o.meta_type == 'ERP5 Base Category' or \ if o.meta_type == 'ERP5 Category' or o.meta_type == 'ERP5 Base Category' or \
o.meta_type == 'CMF Category' or o.meta_type == 'CMF Base Category': o.meta_type == 'CMF Category' or o.meta_type == 'CMF Base Category':
# This goes up in the category tree # This goes up in the category tree
...@@ -113,7 +113,7 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool): ...@@ -113,7 +113,7 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
if not strict: if not strict:
while o.meta_type == 'ERP5 Category' or o.meta_type == 'CMF Category': while o.meta_type == 'ERP5 Category' or o.meta_type == 'CMF Category':
o = o.aq_parent o = o.aq_parent
uid_dict[(int(o.uid), bo_uid, 0)] = 1 # Non strict uid_dict[(o.getUid(), bo_uid, 0)] = 1 # Non strict
except (TypeError, KeyError): except (TypeError, KeyError):
LOG('WARNING: CategoriesTool',0, 'Unable to find uid for %s' % path) LOG('WARNING: CategoriesTool',0, 'Unable to find uid for %s' % path)
return uid_dict.keys() return uid_dict.keys()
......
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