Commit 353a25b2 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Only add the category ID if it is not already in _categories, which

may happen when getting the categories with acquisition as done in
test_getAcquiredCategoryList for example. This fixes testERP5Category.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43959 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2a92c4e1
......@@ -229,7 +229,10 @@ class CategoryProperty(IdAsReferenceMixin('_category'), XMLObject):
accessor = Alias.Reindex(accessor_name[1:], accessor_name)
accessor_holder.registerAccessor(accessor, write_permission)
accessor_holder._categories.append(category_id)
# Only add the category ID if it is not already in _categories,
# which may happen when getting the categories with acquisition
if category_id not in accessor_holder._categories:
accessor_holder._categories.append(category_id)
security.declareProtected(Permissions.AccessContentsInformation,
'applyOnAccessorHolder')
......
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