From 70267eade49f5dbddcec4535b266a2664ef74cc8 Mon Sep 17 00:00:00 2001 From: Greg Von Kuster Date: Wed, 9 Jun 2010 15:07:39 -0400 Subject: [PATCH] Do not allow the dataset to be purged ( set purgable to False ) for datasets uploaded to a library where the file is not copied into Galaxy's default file location. --- lib/galaxy/web/controllers/library_common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/web/controllers/library_common.py b/lib/galaxy/web/controllers/library_common.py index 6dae1804e6f..03b975e0aa2 100644 --- a/lib/galaxy/web/controllers/library_common.py +++ b/lib/galaxy/web/controllers/library_common.py @@ -932,7 +932,10 @@ class LibraryCommon( BaseController ): if params.get( 'link_data_only', False ): uploaded_dataset.link_data_only = True uploaded_dataset.data.file_name = os.path.abspath( path ) - trans.sa_session.add( uploaded_dataset.data ) + # Since we are not copying the file into Galaxy's managed + # default file location, the dataset should never be purgable. + uploaded_dataset.data.dataset.purgable = False + trans.sa_session.add_all( ( uploaded_dataset.data, uploaded_dataset.data.dataset ) ) trans.sa_session.flush() return uploaded_dataset def get_server_dir_uploaded_datasets( self, trans, cntrller, params, full_dir, import_dir_desc, library_bunch, err_redirect, message ):