Merge pull request #10761 from assuntad23/bugfix/papercut/copy_dataset_tags_when_copying_collection

changed copy_tags to an array in copy_tags_to and added copy_tags par…
This commit is contained in:
Marius van den Beek
2020-11-19 10:53:30 +01:00
committed by GitHub
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -3224,6 +3224,7 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
flush=False)
# update init non-keywords as well
hda.purged = self.purged
hda.copy_tags_to(copy_tags)
object_session(self).add(hda)
hda.metadata = self.metadata
@@ -3237,7 +3238,7 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
def copy_tags_to(self, copy_tags=None):
if copy_tags is not None:
for tag in copy_tags.values():
for tag in copy_tags:
copied_tag = tag.copy(cls=HistoryDatasetAssociationTagAssociation)
self.tags.append(copied_tag)
@@ -4656,7 +4657,7 @@ class DatasetCollectionElement(Dictifiable, RepresentById):
flush=flush
)
else:
new_element_object = element_object.copy(flush=flush)
new_element_object = element_object.copy(flush=flush, copy_tags=element_object.tags)
new_element_object.visible = False
if destination is not None and element_object.hidden_beneath_collection_instance:
new_element_object.hidden_beneath_collection_instance = destination
+1 -1
View File
@@ -413,7 +413,7 @@ class DefaultToolAction:
trans.sa_session.add(data)
if not completed_job:
trans.app.security_agent.set_all_dataset_permissions(data.dataset, output_permissions, new=True, flush=False)
data.copy_tags_to(preserved_tags)
data.copy_tags_to(preserved_tags.values())
if not completed_job and trans.app.config.legacy_eager_objectstore_initialization:
# Must flush before setting object store id currently.