[open-ils-commits] r8601 -
branches/acq-experiment/Open-ILS/src/python/oils
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Feb 4 11:52:12 EST 2008
Author: erickson
Date: 2008-02-04 11:24:01 -0500 (Mon, 04 Feb 2008)
New Revision: 8601
Modified:
branches/acq-experiment/Open-ILS/src/python/oils/org.py
Log:
no longer clobbering client-provided array of orgs
Modified: branches/acq-experiment/Open-ILS/src/python/oils/org.py
===================================================================
--- branches/acq-experiment/Open-ILS/src/python/oils/org.py 2008-02-04 16:23:30 UTC (rev 8600)
+++ branches/acq-experiment/Open-ILS/src/python/oils/org.py 2008-02-04 16:24:01 UTC (rev 8601)
@@ -99,8 +99,15 @@
@staticmethod
def get_union_tree(org_list):
''' Returns the smallest org tree which encompases all of the orgs in org_list '''
- main_tree = OrgUtil.get_related_tree(OrgUtil.get_org_unit(org_list.pop(0)))
- for org in org_list:
+
+ if len(org_list) == 0:
+ return None
+ main_tree = OrgUtil.get_related_tree(OrgUtil.get_org_unit(org_list[0]))
+
+ if len(org_list) == 1:
+ return main_tree
+
+ for org in org_list[1:]:
node = OrgUtil.get_related_tree(OrgUtil.get_org_unit(org))
main_node = main_tree
More information about the open-ils-commits
mailing list