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 +