Skip to content

Commit

Permalink
Fix #18316... I think.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Jun 7, 2024
1 parent 3fc448c commit c5c4041
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/galaxy/files/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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"))
3 changes: 3 additions & 0 deletions lib/galaxy/managers/file_source_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,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
Expand Down

0 comments on commit c5c4041

Please sign in to comment.