From 3a2605963716726602610a0f42d08987ca015099 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 12 Nov 2021 12:23:48 +0100 Subject: [PATCH] Minor cosmetics that hopefully clarifies what is going on here --- lib/galaxy/managers/collections.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/managers/collections.py b/lib/galaxy/managers/collections.py index c4007dc1a8be..3318d3f0aa9e 100644 --- a/lib/galaxy/managers/collections.py +++ b/lib/galaxy/managers/collections.py @@ -599,16 +599,15 @@ def _build_elements_from_rule_data(self, collection_type_description, rule_set, found = True if not found: + # Create a new collection whose elements are defined in the next loop sub_collection: Dict[str, Any] = {} sub_collection["src"] = "new_collection" sub_collection["collection_type"] = collection_type_at_depth.collection_type sub_collection["elements"] = {} - elements_at_depth[ - identifier - ] = sub_collection # ??? but this is overridenn on the next line?? - elements_at_depth = sub_collection[ - "elements" - ] # ??? sub_collection is just lost? + # Update elements with new collection + elements_at_depth[identifier] = sub_collection + # Subsequent loop fills elements of newly created collection + elements_at_depth = sub_collection["elements"] return elements