Commit 6f77913b authored by iv's avatar iv

ERP5Workflow: getSomeCategoryList should return the full paths to the category

parent ff13da35
......@@ -123,8 +123,8 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject,
"""
returns the list of activate script
"""
return [path.split('/')[-1] for path in self.getCategoryList()
if path.startswith('activate_script')]
return [path for path in self.getCategoryList()
if path.startswith('activate_script/')]
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
security.declareProtected(Permissions.AccessContentsInformation,
......@@ -133,5 +133,5 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject,
"""
returns the list of before commit script
"""
return [path.split('/')[-1] for path in self.getCategoryList()
if path.startswith('before_commit_script')]
\ No newline at end of file
return [path for path in self.getCategoryList()
if path.startswith('before_commit_script/')]
......@@ -100,7 +100,8 @@ class State(IdAsReferenceMixin("state_", "prefix"), XMLObject, CustomStorageMatr
instead of getting all the transition objects from the destination list
to then use their ids, extract the information from the string
"""
return [path.split('/')[-1] for path in self.getCategoryList() if path.startswith('destination')]
return [path for path in self.getCategoryList()
if path.startswith('destination/')]
security.declareProtected(Permissions.AccessContentsInformation,
......
......@@ -90,8 +90,8 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject,
"""
returns the list of before script
"""
return [path.split('/')[-1] for path in self.getCategoryList()
if path.startswith('before_script')]
return [path for path in self.getCategoryList()
if path.startswith('before_script/')]
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
security.declareProtected(Permissions.AccessContentsInformation,
......@@ -100,8 +100,8 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject,
"""
returns the list of after script
"""
return [path.split('/')[-1] for path in self.getCategoryList()
if path.startswith('after_script')]
return [path for path in self.getCategoryList()
if path.startswith('after_script/')]
security.declareProtected(Permissions.AccessContentsInformation,
......
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