From de4c2cc75539071ba24b440352e24d4b7bd35468 Mon Sep 17 00:00:00 2001 From: Greg Von Kuster Date: Wed, 13 Jan 2010 18:33:42 -0500 Subject: [PATCH] Bug fix for uploading files to a history. --- lib/galaxy/tools/actions/upload_common.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/tools/actions/upload_common.py b/lib/galaxy/tools/actions/upload_common.py index fba054f6aba..16c3e8ceec8 100644 --- a/lib/galaxy/tools/actions/upload_common.py +++ b/lib/galaxy/tools/actions/upload_common.py @@ -59,7 +59,7 @@ def handle_library_params( trans, params, folder_id, replace_dataset=None ): role = trans.sa_session.query( trans.app.model.Role ).get( role_id ) library_bunch.roles.append( role ) return library_bunch -def get_precreated_datasets( trans, params, data_obj, controller='root' ): +def get_precreated_datasets( trans, params, data_obj, controller='root' ): """ Get any precreated datasets (when using asynchronous uploads). """ @@ -75,15 +75,15 @@ def get_precreated_datasets( trans, params, data_obj, controller='root' ): log.exception( 'Unable to load precreated dataset (%s) sent in upload form' % id ) continue if data_obj is trans.app.model.HistoryDatasetAssociation: - if user is None and trans.galaxy_session.current_history != data.history: + if trans.user is None and trans.galaxy_session.current_history != data.history: log.error( 'Got a precreated dataset (%s) but it does not belong to anonymous user\'s current session (%s)' % ( data.id, trans.galaxy_session.id ) ) - elif data.history.user != user: - log.error( 'Got a precreated dataset (%s) but it does not belong to current user (%s)' % ( data.id, user.id ) ) + elif data.history.user != trans.user: + log.error( 'Got a precreated dataset (%s) but it does not belong to current user (%s)' % ( data.id, trans.user.id ) ) else: rval.append( data ) elif data_obj is trans.app.model.LibraryDatasetDatasetAssociation: if controller == 'library' and not trans.app.security_agent.can_add_library_item( roles, data.library_dataset.folder ): - log.error( 'Got a precreated dataset (%s) but this user (%s) is not allowed to write to it' % ( data.id, user.id ) ) + log.error( 'Got a precreated dataset (%s) but this user (%s) is not allowed to write to it' % ( data.id, trans.user.id ) ) else: rval.append( data ) return rval