From 699e3044bacb2e615e389ce20a6a4bd0e5dcb769 Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Tue, 5 May 2009 17:06:11 -0400 Subject: [PATCH] Fix bug reported by Gunnar Raetsch wherein a traceback is displayed if you view a file while it's uploading. --- lib/galaxy/web/controllers/dataset.py | 2 ++ lib/galaxy/web/controllers/root.py | 2 ++ static/images/eye_icon_grey.png | Bin 0 -> 396 bytes static/images/pencil_icon_grey.png | Bin 0 -> 405 bytes templates/root/history_common.mako | 9 +++++++-- 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 static/images/eye_icon_grey.png create mode 100644 static/images/pencil_icon_grey.png diff --git a/lib/galaxy/web/controllers/dataset.py b/lib/galaxy/web/controllers/dataset.py index dd561dd7d98..c34ad1f8697 100644 --- a/lib/galaxy/web/controllers/dataset.py +++ b/lib/galaxy/web/controllers/dataset.py @@ -103,6 +103,8 @@ class DatasetInterface( BaseController ): if not data: raise paste.httpexceptions.HTTPRequestRangeNotSatisfiable( "Invalid reference dataset id: %s." % str( dataset_id ) ) if trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_ACCESS, dataset = data ): + if data.state == trans.model.Dataset.states.UPLOAD: + return trans.show_error_message( "Please wait until this dataset finishes uploading before attempting to view it." ) if filename is None or filename.lower() == "index": mime = trans.app.datatypes_registry.get_mimetype_by_extension( data.extension.lower() ) trans.response.set_content_type(mime) diff --git a/lib/galaxy/web/controllers/root.py b/lib/galaxy/web/controllers/root.py index 823bc29d6f0..645442a7d74 100644 --- a/lib/galaxy/web/controllers/root.py +++ b/lib/galaxy/web/controllers/root.py @@ -219,6 +219,8 @@ class RootController( BaseController ): if id is not None and data.history.user is not None and data.history.user != trans.user: return trans.show_error_message( "This instance of a dataset (%s) in a history does not belong to you." % ( data.id ) ) if trans.app.security_agent.allow_action( trans.user, data.permitted_actions.DATASET_ACCESS, dataset=data ): + if data.state == trans.model.Dataset.states.UPLOAD: + return trans.show_error_message( "Please wait until this dataset finishes uploading before attempting to edit its metadata." ) params = util.Params( kwd, safe=False ) if params.change: # The user clicked the Save button on the 'Change data type' form diff --git a/static/images/eye_icon_grey.png b/static/images/eye_icon_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..d4da0f92c2dd35bd61a31eff4295d01308d5c322 GIT binary patch literal 396 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPggaR#p)sjiZM7No%;7QQL70(Y)*K0-AbW|YuPggaR#p*np*k<8t3XpkJzX3_EKXmY zq?p&@Akn%%&s>v_??Q{E18dUJF0}#{7gj!%Ny-H+mdCtOQr#a(Tvrn{=3`gM4RV>R zbz&LgF5l4kv(4Y{t*rmoX#eO}`)}z7j1~-X7ntVn=iI@4_(Po6OUpjxE!Wr|h*s=3 zQP4bn$#YVRMc>Qcb@A7~N++lvyxMm2d#%0ku`?|KOxbTaD`xJv>vq8K^roKyp`zDr z{kya0>H*fSb+13z@Hc351$fyqecf5G_MoBf<(oM@j+$Q?P42huo_dwlHSml}gTe~DWM4f$9$g% literal 0 HcmV?d00001 diff --git a/templates/root/history_common.mako b/templates/root/history_common.mako index 5eecdcfb055..fc4ebb3bce0 100644 --- a/templates/root/history_common.mako +++ b/templates/root/history_common.mako @@ -33,8 +33,13 @@ %endif
- display data - edit attributes + %if data_state == "upload": + display data + edit attributes + %else: + display data + edit attributes + %endif delete
${hid}: ${data.display_name()}