details: http://www.bx.psu.edu/hg/galaxy/rev/dd21a47f8035 changeset: 2402:dd21a47f8035 user: Nate Coraor <nate@bx.psu.edu> date: Tue May 05 17:06:11 2009 -0400 description: Fix bug reported by Gunnar Raetsch wherein a traceback is displayed if you view a file while it's uploading. 5 file(s) affected in this change: lib/galaxy/web/controllers/dataset.py lib/galaxy/web/controllers/root.py static/images/eye_icon_grey.png static/images/pencil_icon_grey.png templates/root/history_common.mako diffs (47 lines): diff -r 2e2b80fcbd47 -r dd21a47f8035 lib/galaxy/web/controllers/dataset.py --- a/lib/galaxy/web/controllers/dataset.py Tue May 05 13:48:01 2009 -0400 +++ b/lib/galaxy/web/controllers/dataset.py Tue May 05 17:06:11 2009 -0400 @@ -103,6 +103,8 @@ 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 -r 2e2b80fcbd47 -r dd21a47f8035 lib/galaxy/web/controllers/root.py --- a/lib/galaxy/web/controllers/root.py Tue May 05 13:48:01 2009 -0400 +++ b/lib/galaxy/web/controllers/root.py Tue May 05 17:06:11 2009 -0400 @@ -219,6 +219,8 @@ 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 -r 2e2b80fcbd47 -r dd21a47f8035 static/images/eye_icon_grey.png Binary file static/images/eye_icon_grey.png has changed diff -r 2e2b80fcbd47 -r dd21a47f8035 static/images/pencil_icon_grey.png Binary file static/images/pencil_icon_grey.png has changed diff -r 2e2b80fcbd47 -r dd21a47f8035 templates/root/history_common.mako --- a/templates/root/history_common.mako Tue May 05 13:48:01 2009 -0400 +++ b/templates/root/history_common.mako Tue May 05 17:06:11 2009 -0400 @@ -33,8 +33,13 @@ %endif </div> <div style="float: right;"> - <a href="${h.url_for( controller='dataset', dataset_id=data.id, action='display', filename='index')}" target="galaxy_main"><img src="${h.url_for('/static/images/eye_icon.png')}" rollover="${h.url_for('/static/images/eye_icon_dark.png')}" width='16' height='16' alt='display data' title='display data' class='displayButton' border='0'></a> - <a href="${h.url_for( controller='root', action='edit', id=data.id )}" target="galaxy_main"><img src="${h.url_for('/static/images/pencil_icon.png')}" rollover="${h.url_for('/static/images/pencil_icon_dark.png')}" width='16' height='16' alt='edit attributes' title='edit attributes' class='editButton' border='0'></a> + %if data_state == "upload": + <img src="${h.url_for('/static/images/eye_icon_grey.png')}" width='16' height='16' alt='display data' title='display data' class='displayButton' border='0'> + <img src="${h.url_for('/static/images/pencil_icon_grey.png')}" width='16' height='16' alt='edit attributes' title='edit attributes' class='editButton' border='0'> + %else: + <a href="${h.url_for( controller='dataset', dataset_id=data.id, action='display', filename='index')}" target="galaxy_main"><img src="${h.url_for('/static/images/eye_icon.png')}" rollover="${h.url_for('/static/images/eye_icon_dark.png')}" width='16' height='16' alt='display data' title='display data' class='displayButton' border='0'></a> + <a href="${h.url_for( controller='root', action='edit', id=data.id )}" target="galaxy_main"><img src="${h.url_for('/static/images/pencil_icon.png')}" rollover="${h.url_for('/static/images/pencil_icon_dark.png')}" width='16' height='16' alt='edit attributes' title='edit attributes' class='editButton' border='0'></a> + %endif <a href="${h.url_for( action='delete', id=data.id, show_deleted_on_refresh=show_deleted_on_refresh )}" class="historyItemDelete" id="historyItemDeleter-${data.id}"><img src="${h.url_for('/static/images/delete_icon.png')}" rollover="${h.url_for('/static/images/delete_icon_dark.png')}" width='16' height='16' alt='delete' class='deleteButton' border='0'></a> </div> <span class="historyItemTitle"><b>${hid}: ${data.display_name()}</b></span>