commit/galaxy-central: dannon: Fix several bugs in histories manager.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/eb1b47ff0453/ Changeset: eb1b47ff0453 User: dannon Date: 2015-01-22 22:14:20+00:00 Summary: Fix several bugs in histories manager. Affected #: 1 file diff -r d671e182d2e0ea0d4ccb486efabe32c8353db022 -r eb1b47ff04531023d4e9f19a99c762fb5b16fad6 lib/galaxy/managers/histories.py --- a/lib/galaxy/managers/histories.py +++ b/lib/galaxy/managers/histories.py @@ -5,15 +5,12 @@ created (or copied) by users over the course of an analysis. """ -from galaxy import exceptions +import galaxy.web from galaxy import model - -import galaxy.web - from galaxy.managers import base +from galaxy.managers import hdas from galaxy.managers import sharable -from galaxy.managers import hdas -from galaxy.managers import collections_util +from galaxy.managers.collections_util import dictify_dataset_collection_instance import logging @@ -125,8 +122,6 @@ #TODO: instantiate here? really? history_serializer = HistorySerializer( self.app ) hda_serializer = hdas.HDASerializer( self.app ) - collection_dictifier = collections_util.dictify_dataset_collection_instance - history_dictionary = {} contents_dictionaries = [] try: @@ -147,7 +142,7 @@ instance_type='history', id=self.app.security.encode_id( content.id ), ) - contents_dict = collection_dictifier( dataset_collection_instance, + contents_dict = dictify_dataset_collection_instance( dataset_collection_instance, security=self.app.security, parent=dataset_collection_instance.history, view="element" ) except Exception, exc: @@ -321,13 +316,15 @@ }) def serialize_contents( self, trans, history, key ): + contents_dictionaries = [] for content in history.contents_iter( types=[ 'dataset', 'dataset_collection' ] ): contents_dict = {} if isinstance( content, model.HistoryDatasetAssociation ): - contents_dict = self.hda_serializer.serialize_to_view( trans, hda, view='detailed' ) + contents_dict = self.hda_serializer.serialize_to_view( trans, content, view='detailed' ) elif isinstance( content, model.HistoryDatasetCollectionAssociation ): - contents_dict = self.serialize_collection( trans, collection ) + contents_dict = self.serialize_collection( trans, content ) contents_dictionaries.append( contents_dict ) + return contents_dictionaries def serialize_collection( self, trans, collection ): service = self.app.dataset_collections_service @@ -336,7 +333,7 @@ instance_type='history', id=self.security.encode_id( collection.id ), ) - return collection_dictifier( dataset_collection_instance, + return dictify_dataset_collection_instance( dataset_collection_instance, security=self.app.security, parent=dataset_collection_instance.history, view="element" ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org