Commit 49c371a5 authored by Romain Courteaud's avatar Romain Courteaud

Remove duplicated code.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27712 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 636db232
...@@ -240,23 +240,7 @@ class Category(Folder): ...@@ -240,23 +240,7 @@ class Category(Folder):
""" """
Returns title or id, indented from base_category. Returns title or id, indented from base_category.
""" """
path_len = 0 return self.getIndentedTitle(item_method=item_method)
base = self.getBaseCategory()
current = self
while not current is base :
path_len += 1
current = aq_parent(current)
# it s better for the user to display something than only ''...
logical_title_list = []
if path_len >= 2:
logical_title_list.append(' ' * 4 * (path_len - 1))
logical_title = getattr(self, item_method)()
if logical_title in [None, '']:
logical_title = self.getId()
logical_title_list.append(logical_title)
return ''.join(logical_title_list)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getTranslatedIndentedTitle') 'getTranslatedIndentedTitle')
......
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