Commit c0caabc7 authored by Nicolas Dumazet's avatar Nicolas Dumazet

remove unnecessary indentation level


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35974 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ae4533f4
...@@ -183,39 +183,39 @@ class SupplyChain(Path, XMLObject): ...@@ -183,39 +183,39 @@ class SupplyChain(Path, XMLObject):
if current_supply_link in checked_link_list: if current_supply_link in checked_link_list:
raise SupplyChainError,\ raise SupplyChainError,\
"SupplyLink %r is in a loop." % current_supply_link "SupplyLink %r is in a loop." % current_supply_link
else:
transformation_link_list = []
checked_link_list.append(current_supply_link)
# Get the previous link list
previous_link_list = self.getPreviousSupplyLinkList(current_supply_link)
# Test each link
for previous_link in previous_link_list:
if not previous_link.isProductionSupplyLink():
# current is invalid
if not recursive:
continue
else:
# Great, we found a valid one
transformation_link_list.append(previous_link)
# Prevent infinite loop when 2 production_link have the same
# destination
if (current_supply_link is not None) and \
(current_supply_link.isProductionSupplyLink()):
raise SupplyChainError,\
"Those SupplyLinks are in conflict: %r and %r" %\
(current_supply_link.getRelativeUrl(),\
previous_link.getRelativeUrl())
if not recursive and not all:
continue
# Browse the previous link transformation_link_list = []
transformation_link_list.extend( checked_link_list.append(current_supply_link)
self.getPreviousProductionSupplyLinkList( # Get the previous link list
previous_link, previous_link_list = self.getPreviousSupplyLinkList(current_supply_link)
recursive=recursive, all=all, # Test each link
checked_link_list=checked_link_list)) for previous_link in previous_link_list:
# Return result if not previous_link.isProductionSupplyLink():
return transformation_link_list # current is invalid
if not recursive:
continue
else:
# Great, we found a valid one
transformation_link_list.append(previous_link)
# Prevent infinite loop when 2 production_link have the same
# destination
if (current_supply_link is not None) and \
(current_supply_link.isProductionSupplyLink()):
raise SupplyChainError,\
"Those SupplyLinks are in conflict: %r and %r" %\
(current_supply_link.getRelativeUrl(),\
previous_link.getRelativeUrl())
if not recursive and not all:
continue
# Browse the previous link
transformation_link_list.extend(
self.getPreviousProductionSupplyLinkList(
previous_link,
recursive=recursive, all=all,
checked_link_list=checked_link_list))
# Return result
return transformation_link_list
security.declareProtected(Permissions.View, security.declareProtected(Permissions.View,
'getPreviousPackingListSupplyLinkList') 'getPreviousPackingListSupplyLinkList')
......
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