commit/galaxy-central: jgoecks: When deleting a history and marking associated jobs deleted, first check that there is a job to mark.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/d207aa915b9d/ Changeset: d207aa915b9d User: jgoecks Date: 2013-05-04 00:02:57 Summary: When deleting a history and marking associated jobs deleted, first check that there is a job to mark. Affected #: 1 file diff -r e7feb8e93b6e862b8b450dc5a9636297cea28516 -r d207aa915b9d89167858439df97bf385669b4a2d lib/galaxy/webapps/galaxy/controllers/history.py --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -563,11 +563,14 @@ self.sa_session.add( history ) self.sa_session.flush() for hda in history.datasets: - job = hda.creating_job_associations[0].job - if job.history_id == history.id and job.state in [ trans.app.model.Job.states.QUEUED, trans.app.model.Job.states.RUNNING, trans.app.model.Job.states.NEW ]: - # No need to check other outputs since the job's parent history is this history - job.mark_deleted( trans.app.config.track_jobs_in_database ) - trans.app.job_manager.job_stop_queue.put( job.id ) + # Not all datasets have jobs associated with them (e.g., datasets imported from libraries). + if hda.creating_job_associations: + # HDA has associated job, so try marking it deleted. + job = hda.creating_job_associations[0].job + if job.history_id == history.id and job.state in [ trans.app.model.Job.states.QUEUED, trans.app.model.Job.states.RUNNING, trans.app.model.Job.states.NEW ]: + # No need to check other outputs since the job's parent history is this history + job.mark_deleted( trans.app.config.track_jobs_in_database ) + trans.app.job_manager.job_stop_queue.put( job.id ) # Regardless of whether it was previously deleted, we make a new history active trans.new_history() return trans.show_ok_message( "History deleted, a new history is active", refresh_frames=['history'] ) 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