From 6f9701bb413962b97a404fcba4e5a52ce8832b42 Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Thu, 18 Aug 2011 13:08:39 -0400 Subject: [PATCH] Decrease disk usage and actually remove datasets (if applicable) when purging a history. --- lib/galaxy/web/controllers/history.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/web/controllers/history.py b/lib/galaxy/web/controllers/history.py index 6341dbd6662..c4eeab51c02 100644 --- a/lib/galaxy/web/controllers/history.py +++ b/lib/galaxy/web/controllers/history.py @@ -271,9 +271,12 @@ class HistoryController( BaseController, Sharable, UsesAnnotations, UsesItemRati n_deleted += 1 if purge and trans.app.config.allow_user_dataset_purge: for hda in history.datasets: + if trans.user: + trans.user.total_disk_usage -= hda.quota_amount( trans.user ) hda.purged = True trans.sa_session.add( hda ) trans.log_event( "HDA id %s has been purged" % hda.id ) + trans.sa_session.flush() if hda.dataset.user_can_purge: try: hda.dataset.full_delete() @@ -1207,4 +1210,4 @@ class HistoryController( BaseController, Sharable, UsesAnnotations, UsesItemRati def get_item( self, trans, id ): return self.get_history( trans, id ) - \ No newline at end of file +