[hg] galaxy 1534: Fix for disk usage report in the webapps syste...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[hg] galaxy 1534: Fix for disk usage report in the webapps syste...

Greg Von Kuster
details:   http://www.bx.psu.edu/hg/galaxy/rev/1706aadf16b2
changeset: 1534:1706aadf16b2
user:      Greg Von Kuster <[hidden email]>
date:      Mon Sep 29 10:37:54 2008 -0400
description:
Fix for disk usage report in the webapps system controller.

1 file(s) affected in this change:

lib/galaxy/webapps/reports/controllers/system.py

diffs (20 lines):

diff -r 3830fefb07da -r 1706aadf16b2 lib/galaxy/webapps/reports/controllers/system.py
--- a/lib/galaxy/webapps/reports/controllers/system.py Fri Sep 26 14:22:37 2008 -0400
+++ b/lib/galaxy/webapps/reports/controllers/system.py Mon Sep 29 10:37:54 2008 -0400
@@ -157,13 +157,15 @@
         disk_usage = self.get_disk_usage( file_path )
         min_file_size = 2**32 # 4 Gb
         file_size_str = nice_size( min_file_size )
+        hda = trans.model.HistoryDatasetAssociation
         d = trans.model.Dataset
         datasets = []
         where = ( d.table.c.file_size > min_file_size )
         dataset_rows = d.query().filter( where ).order_by( desc( d.table.c.file_size ) )
 
         for dataset in dataset_rows:
-            datasets.append( ( dataset.id, str( dataset.update_time )[0:10], dataset.history_id, dataset.deleted, dataset.file_size ) )
+            history_dataset_assoc = hda.filter_by( dataset_id=dataset.id ).order_by( desc( hda.table.c.history_id ) ).all()[0]
+            datasets.append( ( dataset.id, str( dataset.update_time )[0:10], history_dataset_assoc.history_id, dataset.deleted, dataset.file_size ) )
         return file_path, disk_usage, datasets, file_size_str
 
 def nice_size( size ):