Commit 769106f1 authored by Nicolas Dumazet's avatar Nicolas Dumazet

continue_recursivity variable was just unneeded, difficult to read trickery


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35972 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2d335c7d
...@@ -188,9 +188,12 @@ class SupplyChain(Path, XMLObject): ...@@ -188,9 +188,12 @@ class SupplyChain(Path, XMLObject):
previous_link_list = self.getPreviousSupplyLinkList(current_supply_link) previous_link_list = self.getPreviousSupplyLinkList(current_supply_link)
# Test each link # Test each link
for previous_link in previous_link_list: for previous_link in previous_link_list:
continue_recursivity = False if not previous_link.isProductionSupplyLink():
# Great, we find a valid one # current is invalid
if previous_link.isProductionSupplyLink(): if not recursive:
continue
else:
# Great, we found a valid one
transformation_link_list.append(previous_link) transformation_link_list.append(previous_link)
# Prevent infinite loop when 2 production_link have the same # Prevent infinite loop when 2 production_link have the same
# destination # destination
...@@ -200,13 +203,9 @@ class SupplyChain(Path, XMLObject): ...@@ -200,13 +203,9 @@ class SupplyChain(Path, XMLObject):
"Those SupplyLinks are in conflict: %r and %r" %\ "Those SupplyLinks are in conflict: %r and %r" %\
(current_supply_link.getRelativeUrl(),\ (current_supply_link.getRelativeUrl(),\
previous_link.getRelativeUrl()) previous_link.getRelativeUrl())
if all: if not recursive and not all:
continue_recursivity = True continue
# Reject the current
elif recursive:
continue_recursivity = True
# Continue to browse the chain ?
if continue_recursivity:
# Browse the previous link # Browse the previous link
transformation_link_list.extend( transformation_link_list.extend(
self.getPreviousProductionSupplyLinkList( self.getPreviousProductionSupplyLinkList(
......
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