Loading lib/galaxy/model/__init__.py +3 −0 Original line number Diff line number Diff line Loading @@ -5811,6 +5811,9 @@ class HistoryDatasetCollectionAssociation( """Checks to see that the indicated collection is a member of the hdca by using a recursive CTE sql query to find the collection's parents and checking to see if any of the parents are associated with this hdca""" if collection_id == self.collection_id: # collection_id is root collection return True sa_session = object_session(self) DCE = DatasetCollectionElement Loading lib/galaxy/webapps/galaxy/services/dataset_collections.py +1 −1 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ class DatasetCollectionsService(ServiceBase, UsesLibraryMixinItems): # check to make sure the dsc is part of the validated hdca decoded_parent_id = self.decode_id(parent_id) if parent_id != hdca_id and not hdca.contains_collection(decoded_parent_id): if not hdca.contains_collection(decoded_parent_id): raise exceptions.ObjectNotFound('Requested dataset collection is not contained within indicated history content') # retrieve contents Loading lib/galaxy_test/api/test_dataset_collections.py +8 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,14 @@ class DatasetCollectionApiTestCase(ApiTestCase): assert len(offset_contents) == 1 assert offset_contents[0]['element_index'] == 1 def test_collection_contents_empty_root(self): hdca = self.dataset_collection_populator.create_list_in_history(self.history_id, contents=[]).json() assert hdca["elements"] == [] root_contents_url = hdca["contents_url"] response = self._get(root_contents_url) response.raise_for_status() assert response.json() == [] def test_get_suitable_converters_single_datatype(self): response = self.dataset_collection_populator.upload_collection(self.history_id, "list:paired", elements=[ { Loading Loading
lib/galaxy/model/__init__.py +3 −0 Original line number Diff line number Diff line Loading @@ -5811,6 +5811,9 @@ class HistoryDatasetCollectionAssociation( """Checks to see that the indicated collection is a member of the hdca by using a recursive CTE sql query to find the collection's parents and checking to see if any of the parents are associated with this hdca""" if collection_id == self.collection_id: # collection_id is root collection return True sa_session = object_session(self) DCE = DatasetCollectionElement Loading
lib/galaxy/webapps/galaxy/services/dataset_collections.py +1 −1 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ class DatasetCollectionsService(ServiceBase, UsesLibraryMixinItems): # check to make sure the dsc is part of the validated hdca decoded_parent_id = self.decode_id(parent_id) if parent_id != hdca_id and not hdca.contains_collection(decoded_parent_id): if not hdca.contains_collection(decoded_parent_id): raise exceptions.ObjectNotFound('Requested dataset collection is not contained within indicated history content') # retrieve contents Loading
lib/galaxy_test/api/test_dataset_collections.py +8 −0 Original line number Diff line number Diff line Loading @@ -358,6 +358,14 @@ class DatasetCollectionApiTestCase(ApiTestCase): assert len(offset_contents) == 1 assert offset_contents[0]['element_index'] == 1 def test_collection_contents_empty_root(self): hdca = self.dataset_collection_populator.create_list_in_history(self.history_id, contents=[]).json() assert hdca["elements"] == [] root_contents_url = hdca["contents_url"] response = self._get(root_contents_url) response.raise_for_status() assert response.json() == [] def test_get_suitable_converters_single_datatype(self): response = self.dataset_collection_populator.upload_collection(self.history_id, "list:paired", elements=[ { Loading