diff --git a/lib/galaxy/managers/hdas.py b/lib/galaxy/managers/hdas.py index e724d660a59..18e9955e906 100644 --- a/lib/galaxy/managers/hdas.py +++ b/lib/galaxy/managers/hdas.py @@ -143,14 +143,18 @@ class HDAManager( datasets.DatasetAssociationManager, return ldda.to_history_dataset_association( history, add_to_history=True ) # .... deletion and purging - def purge( self, hda, current_user=None, flush=True ): + def purge( self, hda, flush=True): """ Purge this HDA and the dataset underlying it. """ + user = hda.history.user or None + quota_amount_reduction = 0 + if user: + quota_amount_reduction = hda.quota_amount( user ) super( HDAManager, self ).purge( hda, flush=flush ) # decrease the user's space used - if current_user: - current_user.total_disk_usage -= hda.quota_amount( current_user ) + if quota_amount_reduction: + user.total_disk_usage -= quota_amount_reduction return hda # .... states diff --git a/lib/galaxy/managers/histories.py b/lib/galaxy/managers/histories.py index 14e53aa230d..1ebe9269bdb 100644 --- a/lib/galaxy/managers/histories.py +++ b/lib/galaxy/managers/histories.py @@ -82,7 +82,6 @@ class HistoryManager( sharable.SharableModelManager, deletable.PurgableManagerMi Purge this history and all HDAs, Collections, and Datasets inside this history. """ self.hda_manager.dataset_manager.error_unless_dataset_purge_allowed() - # First purge all the datasets for hda in history.datasets: if not hda.purged: