Merge pull request #7286 from abretaud/export_bug

Fix ObjectNotFound exception when exporting an history
This commit is contained in:
John Chilton
2019-02-04 10:48:06 -05:00
committed by GitHub
+13 -3
View File
@@ -11,6 +11,7 @@ from sqlalchemy.sql import expression
from galaxy import model
from galaxy.exceptions import MalformedContents
from galaxy.exceptions import ObjectNotFound
from galaxy.model.item_attrs import UsesAnnotations
from galaxy.web.framework.helpers import to_unicode
@@ -341,12 +342,21 @@ class JobExportHistoryArchiveWrapper(UsesAnnotations):
"designation": obj.designation,
"deleted": obj.deleted,
"visible": obj.visible,
"file_name": obj.file_name,
"uuid": (lambda uuid: str(uuid) if uuid else None)(obj.dataset.uuid),
"annotation": to_unicode(getattr(obj, 'annotation', '')),
"tags": get_item_tag_dict(obj),
"extra_files_path": obj.extra_files_path
"tags": get_item_tag_dict(obj)
}
try:
rval['file_name'] = obj.file_name
except ObjectNotFound:
rval['file_name'] = None
if obj.extra_files_path_exists():
rval['extra_files_path'] = obj.extra_files_path
else:
rval['extra_files_path'] = None
if not obj.visible and not include_hidden:
rval['exported'] = False
elif obj.deleted and not include_deleted: