Commit 48624e09 authored by Alexandre Boeglin's avatar Alexandre Boeglin

registerBaseCategories : force the category_list to be a tuple instead of a string,

  when the comma was forgotten in a single element tuple.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2450 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f9de6b77
...@@ -338,8 +338,11 @@ def importLocalPropertySheet(class_id, path = None): ...@@ -338,8 +338,11 @@ def importLocalPropertySheet(class_id, path = None):
base_category_dict = {} base_category_dict = {}
def registerBaseCategories(property_sheet): def registerBaseCategories(property_sheet):
global base_category_dict global base_category_dict
for bc in getattr(property_sheet, '_categories', ()): category_list = getattr(property_sheet, '_categories', ())
LOG('registerBaseCategories', 0, 'bc = %r' % (bc,)) if type(category_list) is type('') :
category_list = (category_list,)
for bc in category_list :
LOG('registerBaseCategories', 0, 'bc = %r in %s' % (bc, property_sheet))
base_category_dict[bc] = 1 base_category_dict[bc] = 1
def importLocalInterface(class_id, path = None): def importLocalInterface(class_id, path = 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