Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #18316 (anonymous file sources) #18352

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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
Expand Down
Loading