From 00a274c26a11b45c5908dbd1149a2b233657d917 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 15 Oct 2021 17:47:52 +0200 Subject: [PATCH] Explicitly pass history into DatasetCollectionManager.create --- lib/galaxy/managers/collections.py | 4 ++-- lib/galaxy/webapps/galaxy/api/dataset_collections.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/managers/collections.py b/lib/galaxy/managers/collections.py index 57a06b41313..26a87d4d6cc 100644 --- a/lib/galaxy/managers/collections.py +++ b/lib/galaxy/managers/collections.py @@ -201,7 +201,6 @@ class DatasetCollectionManager: has_subcollections = collection_type_description.has_subcollections() # If we have elements, this is an internal request, don't need to load # objects from identifiers. - history = history or trans.history if elements is None: elements = self._element_identifiers_to_elements(trans, collection_type_description=collection_type_description, @@ -209,7 +208,8 @@ class DatasetCollectionManager: hide_source_items=hide_source_items, copy_elements=copy_elements, history=history) - history.add_pending_items() + if history: + history.add_pending_items() else: if has_subcollections: # Nested collection - recursively create collections as needed. diff --git a/lib/galaxy/webapps/galaxy/api/dataset_collections.py b/lib/galaxy/webapps/galaxy/api/dataset_collections.py index be12e008075..e9430705a4f 100644 --- a/lib/galaxy/webapps/galaxy/api/dataset_collections.py +++ b/lib/galaxy/webapps/galaxy/api/dataset_collections.py @@ -42,7 +42,7 @@ class DatasetCollectionsController( :type payload: dict :param payload: (optional) dictionary structure containing: - * collection_type: dataset colltion type to create. + * collection_type: dataset collection type to create. * instance_type: Instance type - 'history' or 'library'. * name: the new dataset collections's name * datasets: object describing datasets for collection @@ -57,6 +57,7 @@ class DatasetCollectionsController( history_id = decode_id(self.app, history_id) history = self.history_manager.get_owned(history_id, trans.user, current_history=trans.history) create_params["parent"] = history + create_params["history"] = history elif instance_type == "library": folder_id = payload.get('folder_id') library_folder = self.get_library_folder(trans, folder_id, check_accessible=True)