Commit 79faf8b3 authored by iv's avatar iv

ERP5Workflow: remove category name from the path for overriden getSomeCategoryList

parent b1d54882
......@@ -123,7 +123,8 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject,
"""
returns the list of activate script
"""
return [path for path in self.getCategoryList()
prefix_length = len('activate_script/')
return [path[prefix_length:] for path in self.getCategoryList()
if path.startswith('activate_script/')]
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
......@@ -133,5 +134,6 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject,
"""
returns the list of before commit script
"""
return [path for path in self.getCategoryList()
prefix_length = len('before_commit_script/')
return [path[prefix_length:] 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 for path in self.getCategoryList()
prefix_length = len('destination/')
return [path[prefix_length:] for path in self.getCategoryList()
if path.startswith('destination/')]
......
......@@ -90,7 +90,8 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject,
"""
returns the list of before script
"""
return [path for path in self.getCategoryList()
prefix_length = len('before_script/')
return [path[prefix_length:] for path in self.getCategoryList()
if path.startswith('before_script/')]
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
......@@ -100,7 +101,8 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject,
"""
returns the list of after script
"""
return [path for path in self.getCategoryList()
prefix_length = len('after_script/')
return [path[prefix_length:] for path in self.getCategoryList()
if path.startswith('after_script/')]
......
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