Commit 3825ff74 authored by Yoshinori Okuji's avatar Yoshinori Okuji

There is no reason to use restrictedTraverse inside an unrestricted method....

There is no reason to use restrictedTraverse inside an unrestricted method. Rewrite unreadable code.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38186 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e556ab75
......@@ -331,16 +331,15 @@ class OrderBuilder(XMLObject, Amount, Predicate):
portal = self.getPortalObject()
delivery_module = getattr(portal, self.getDeliveryModule())
if update:
delivery_to_update_list = [portal.restrictedTraverse(relative_url) for \
unrestrictedTraverse = portal.unrestrictedTraverse
delivery_to_update_list = [unrestrictedTraverse(relative_url) for \
relative_url in delivery_relative_url_list]
# Deliveries we are trying to update
delivery_select_method_id = self.getDeliverySelectMethodId()
if delivery_select_method_id not in ["", None]:
to_update_delivery_sql_list = getattr(self, delivery_select_method_id) \
(movement_list=movement_list)
delivery_to_update_list.extend([sql_delivery.getObject() \
for sql_delivery \
in to_update_delivery_sql_list])
if delivery_select_method_id:
delivery_select_method = getattr(self, delivery_select_method_id)
for brain in delivery_select_method(movement_list=movement_list):
delivery_to_update_list.append(brain.getObject())
else:
delivery_to_update_list = []
# We do not want to update the same object more than twice in one
......
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