From 7acf35f9a56f8142ea666450517030868638f735 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 6 Jun 2024 11:21:59 -0400 Subject: [PATCH] Fix #18316... I think. --- lib/galaxy/files/__init__.py | 11 +++++++++++ lib/galaxy/managers/file_source_instances.py | 3 +++ 2 files changed, 14 insertions(+) diff --git a/lib/galaxy/files/__init__.py b/lib/galaxy/files/__init__.py index 58aea54181be..eb3542982883 100644 --- a/lib/galaxy/files/__init__.py +++ b/lib/galaxy/files/__init__.py @@ -360,6 +360,9 @@ def user_vault(self) -> Dict[str, Any]: ... @property def app_vault(self) -> Dict[str, Any]: ... + @property + def anonymous(self) -> bool: ... + OptionalUserContext = Optional[FileSourcesUserContext] @@ -422,6 +425,10 @@ def app_vault(self): def file_sources(self): return self.trans.app.file_sources + @property + def anonymous(self) -> bool: + return self.trans.anonymous + class DictFileSourcesUserContext(FileSourcesUserContext, FileSourceDictifiable): def __init__(self, **kwd): @@ -466,3 +473,7 @@ def app_vault(self): @property def file_sources(self): return self._kwd.get("file_sources") + + @property + def anonymous(self) -> bool: + return bool(self._kwd.get("username")) diff --git a/lib/galaxy/managers/file_source_instances.py b/lib/galaxy/managers/file_source_instances.py index ba3bacde540e..e4e938a457ec 100644 --- a/lib/galaxy/managers/file_source_instances.py +++ b/lib/galaxy/managers/file_source_instances.py @@ -483,6 +483,9 @@ def user_file_sources_to_dicts( exclude_kind: Optional[Set[PluginKind]] = None, ) -> List[FilesSourceProperties]: """Write out user file sources as list of config dictionaries.""" + if user_context.anonymous: + return [] + as_dicts = [] for files_source_properties in self._all_user_file_source_properties(user_context): plugin_kind = PluginKind.rfs