From 9df2b4b8f7601a5682c46ee8bb223903f884be5c Mon Sep 17 00:00:00 2001 From: dpryan79 Date: Mon, 15 May 2017 15:37:35 +0200 Subject: [PATCH] Don't try to get the file name of purged files --- lib/galaxy/managers/datasets.py | 10 ++++++---- templates/show_params.mako | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/managers/datasets.py b/lib/galaxy/managers/datasets.py index 9104f1fcd920..db95c1f0aa1d 100644 --- a/lib/galaxy/managers/datasets.py +++ b/lib/galaxy/managers/datasets.py @@ -186,9 +186,10 @@ def serialize_file_name( self, dataset, key, user=None, **context ): of the file that contains this dataset's data. """ is_admin = self.user_manager.is_admin( user ) - # expensive: allow conifg option due to cost of operation + # expensive: allow config option due to cost of operation if is_admin or self.app.config.expose_dataset_path: - return dataset.file_name + if not dataset.purged: + return dataset.file_name self.skip() def serialize_extra_files_path( self, dataset, key, user=None, **context ): @@ -196,9 +197,10 @@ def serialize_extra_files_path( self, dataset, key, user=None, **context ): If the config allows or the user is admin, return the file path. """ is_admin = self.user_manager.is_admin( user ) - # expensive: allow conifg option due to cost of operation + # expensive: allow config option due to cost of operation if is_admin or self.app.config.expose_dataset_path: - return dataset.extra_files_path + if not dataset.purged: + return dataset.extra_files_path self.skip() def serialize_permissions( self, dataset, key, user=None, **context ): diff --git a/templates/show_params.mako b/templates/show_params.mako index f93f50eaa3cb..931ef7ef9f27 100644 --- a/templates/show_params.mako +++ b/templates/show_params.mako @@ -188,7 +188,9 @@ UUID:${hda.dataset.uuid} %endif %if trans.user_is_admin() or trans.app.config.expose_dataset_path: - Full Path:${hda.file_name | h} + %if not hda.purged: + Full Path:${hda.file_name | h} + %endif %endif