From 019f554e4e8425635c4ba36d7d2500d3a3a7502c Mon Sep 17 00:00:00 2001 From: guerler Date: Fri, 11 Nov 2016 07:57:45 -0500 Subject: [PATCH] Copy hid attribute to converted datasets for hdas only --- lib/galaxy/model/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 19dea6da5a0..8f8f9cf44c1 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -2081,8 +2081,8 @@ class DatasetInstance( object ): except KeyError: pass # No deps new_dataset = next(iter(self.datatype.convert_dataset( trans, self, target_ext, return_output=True, visible=False, deps=deps, set_output_history=True, target_context=target_context ).values())) - new_dataset.hid = self.hid new_dataset.name = self.name + self.copy_attributes( new_dataset ) assoc = ImplicitlyConvertedDatasetAssociation( parent=self, file_type=target_ext, dataset=new_dataset, metadata_safe=False ) session = trans.sa_session session.add( new_dataset ) @@ -2090,6 +2090,12 @@ class DatasetInstance( object ): session.flush() return new_dataset + def copy_attributes( self, new_dataset ): + """ + Copies attributes to a new datasets, used for implicit conversions + """ + pass + def get_metadata_dataset( self, dataset_ext ): """ Returns an HDA that points to a metadata file which contains a @@ -2342,6 +2348,9 @@ class HistoryDatasetAssociation( DatasetInstance, Dictifiable, UsesAnnotations, object_session( self ).flush() return hda + def copy_attributes( self, new_dataset ): + new_dataset.hid = self.hid + def to_library_dataset_dataset_association( self, trans, target_folder, replace_dataset=None, parent_id=None, user=None, roles=None, ldda_message='' ): """