commit/galaxy-central: natefoo: Controller updates for the resubmitted dataset instance state (thanks Carl!)
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/d301ac50aa86/ Changeset: d301ac50aa86 User: natefoo Date: 2014-08-12 21:21:40 Summary: Controller updates for the resubmitted dataset instance state (thanks Carl!) Affected #: 2 files diff -r d30b580ffbc5cdb5f9fe8fcefe7261152fab1303 -r d301ac50aa86a94e230d44eb2ae10c6c0e354b88 lib/galaxy/jobs/__init__.py --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -940,10 +940,9 @@ def mark_as_resubmitted( self ): job = self.get_job() self.sa_session.refresh( job ) - # TODO: Enable this code once a UI for resubmitted datasets exists - #for dataset in [ dataset_assoc.dataset for dataset_assoc in job.output_datasets + job.output_library_datasets ]: - # dataset._state = model.Dataset.states.RESUBMITTED - # self.sa_session.add( dataset ) + for dataset in [ dataset_assoc.dataset for dataset_assoc in job.output_datasets + job.output_library_datasets ]: + dataset._state = model.Dataset.states.RESUBMITTED + self.sa_session.add( dataset ) job.state = model.Job.states.RESUBMITTED self.sa_session.add( job ) self.sa_session.flush() diff -r d30b580ffbc5cdb5f9fe8fcefe7261152fab1303 -r d301ac50aa86a94e230d44eb2ae10c6c0e354b88 lib/galaxy/webapps/galaxy/api/history_contents.py --- a/lib/galaxy/webapps/galaxy/api/history_contents.py +++ b/lib/galaxy/webapps/galaxy/api/history_contents.py @@ -131,15 +131,20 @@ """ 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' : hda.state, + 'state' : state, 'deleted': hda.deleted, 'visible': hda.visible, 'purged': hda.purged, + 'resubmitted': hda._state == trans.app.model.Dataset.states.RESUBMITTED, 'hid' : hda.hid, 'history_content_type' : hda.history_content_type, 'url' : url_for( 'history_content_typed', history_id=encoded_history_id, id=encoded_id, type="dataset" ), @@ -157,6 +162,9 @@ 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 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