From fe523237c6a8e8d1cf309b3a1bdd728dcfefc8b2 Mon Sep 17 00:00:00 2001 From: Carl Eberhard Date: Fri, 27 Feb 2015 10:03:47 -0500 Subject: [PATCH] Fix display_structure by using serializer; fix structure by removing extra decode_id --- lib/galaxy/webapps/galaxy/controllers/history.py | 8 +++++--- templates/webapps/galaxy/history/display_structured.mako | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/controllers/history.py b/lib/galaxy/webapps/galaxy/controllers/history.py index ceed0b5604c..d5944621143 100644 --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -543,8 +543,10 @@ class HistoryController( BaseUIController, SharableMixin, UsesAnnotations, UsesI def structure( self, trans, id=None, **kwargs ): """ """ - id = self.decode_id( id ) if id else trans.history.id - history_to_view = self.history_manager.get_accessible( trans, id, trans.user ) + unencoded_history_id = trans.history.id + if id: + unencoded_history_id = self.decode_id( id ) + history_to_view = self.history_manager.get_accessible( trans, unencoded_history_id, trans.user ) history_data = self.history_manager._get_history_data( trans, history_to_view ) history_dictionary = history_data[ 'history' ] @@ -552,7 +554,7 @@ class HistoryController( BaseUIController, SharableMixin, UsesAnnotations, UsesI jobs = ( trans.sa_session.query( trans.app.model.Job ) .filter( trans.app.model.Job.user == trans.user ) - .filter( trans.app.model.Job.history_id == self.decode_id( id ) ) ).all() + .filter( trans.app.model.Job.history_id == unencoded_history_id ) ).all() jobs = map( lambda j: self.encode_all_ids( trans, j.to_dict( 'element' ), True ), jobs ) tools = {} diff --git a/templates/webapps/galaxy/history/display_structured.mako b/templates/webapps/galaxy/history/display_structured.mako index effe151a80b..687a9e8dd74 100644 --- a/templates/webapps/galaxy/history/display_structured.mako +++ b/templates/webapps/galaxy/history/display_structured.mako @@ -128,13 +128,15 @@ ## ---------------------------------------------------------------------------- <%def name="javascripts()"> <% + from galaxy.managers import hdas + hda_serializer = hdas.HDASerializer( trans.app ) self.js_app = 'display-structured' controller = trans.webapp.controllers[ 'history' ] hda_dicts = [] id_hda_dict_map = {} for hda in history.active_datasets: - hda_dict = controller.get_hda_dict( trans, hda ) + hda_dict = hda_serializer.serialize_to_view( trans, hda, 'detailed' ) id_hda_dict_map[ hda_dict[ 'id' ] ] = hda_dict hda_dicts.append( hda_dict ) %>