diff --git a/lib/galaxy/web/base/controller.py b/lib/galaxy/web/base/controller.py index bc708d8b79e..d1fe1fe785d 100644 --- a/lib/galaxy/web/base/controller.py +++ b/lib/galaxy/web/base/controller.py @@ -800,6 +800,12 @@ class UsesHistoryDatasetAssociationMixin: history_id = trans.security.encode_id( hda.history.id ), history_content_id = trans.security.encode_id( hda.id ) ) + # resubmitted is not a real state + hda_dict[ 'resubmitted' ] = False + if hda.state == trans.app.model.Dataset.states.RESUBMITTED: + hda_dict[ 'state' ] = hda.dataset.state + hda_dict[ 'resubmitted' ] = True + # indeces, assoc. metadata files, etc. meta_files = [] for meta_type in hda.metadata.spec.keys(): diff --git a/lib/galaxy/webapps/galaxy/api/history_contents.py b/lib/galaxy/webapps/galaxy/api/history_contents.py index 58a8e48a242..b229a126a34 100644 --- a/lib/galaxy/webapps/galaxy/api/history_contents.py +++ b/lib/galaxy/webapps/galaxy/api/history_contents.py @@ -132,15 +132,12 @@ class HistoryContentsController( BaseAPIController, UsesHistoryDatasetAssociatio api_type = "file" encoded_id = trans.security.encode_id( hda.id ) # TODO: handle failed_metadata here as well - state = hda.state - if state == trans.app.model.Dataset.states.RESUBMITTED: - state = hda.dataset.state return { 'id' : encoded_id, 'history_id' : encoded_history_id, 'name' : hda.name, 'type' : api_type, - 'state' : state, + 'state' : hda.dataset.state, 'deleted': hda.deleted, 'visible': hda.visible, 'purged': hda.purged, @@ -162,9 +159,6 @@ class HistoryContentsController( BaseAPIController, UsesHistoryDatasetAssociatio hda_dict = self.get_hda_dict( trans, hda ) hda_dict[ 'display_types' ] = self.get_old_display_applications( trans, hda ) hda_dict[ 'display_apps' ] = self.get_display_apps( trans, hda ) - if hda_dict[ 'state' ] == trans.app.model.Dataset.states.RESUBMITTED: - hda_dict[ 'state' ] = hda.dataset.state - hda_dict[ 'resubmitted' ] = True return hda_dict except Exception, exc: # catch error here - returning a briefer hda_dict with an error attribute