swancontents: Fix preferred_dir interaction with SWAN_projects#490
Merged
Conversation
SWAN_projects is a special folder in both the classic UI and JupyterLab. Users cannot create and/or rename folders with that name. This was previously enforced with some logic relying on `root_dir` where the hidden assumption was that `root_dir` matches $HOME. This is not the case in JupyterLab where `root_dir` is set to `/eos` and `preferred_dir` is used in conjunction. The effect was that in JupyterLab it is not possible to rename files inside SWAN_projects. It is also not possible to download files from anywhere. The fix is to define a new propety `swan_home` which always resolves to the user home.
tomasr8
commented
Jun 12, 2026
| This is necessary to open files from other users (for sharing tab) | ||
| """ | ||
| if self.root_dir.startswith("/eos/"): | ||
| if self.swan_home.startswith("/eos/"): |
Member
Author
There was a problem hiding this comment.
This fixes file downloads in JupyterLab
rodrigo-sobral
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SWAN_projects is a special folder in both the classic UI and JupyterLab. Users cannot create and/or rename folders with that name. This was previously enforced with some logic relying on
root_dirwhere the hidden assumption was thatroot_dirmatches $HOME. This is not the case in JupyterLab whereroot_diris set to/eosandpreferred_diris used in conjunction.The effect was that in JupyterLab it is not possible to rename files inside SWAN_projects. It is also not possible to download files from anywhere.
The fix is to define a new propety
swan_homewhich always resolves to the user home.