Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Commit

Permalink
Path should not be stored in project config (#12)
Browse files Browse the repository at this point in the history
* `path` should not be stored in project configuration file
Fixes #7

* Small improvements on building os path

* Correct theme extension
  • Loading branch information
fcollonval authored May 30, 2020
1 parent 831cac2 commit f519579
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions jupyter_project/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def post(self, path: str = ""):
filename = cm.increment_filename(filename, path)
fullpath = url_path_join(path, filename)

realpath = Path(cm.root_dir) / url2path(fullpath)
realpath = Path(cm.root_dir).absolute() / url2path(fullpath)
if not realpath.parent.exists():
realpath.parent.mkdir(parents=True)

Expand Down Expand Up @@ -113,7 +113,7 @@ def _get_realpath(self, path: str) -> Path:
Returns:
Path: Absolute path
"""
return Path(self.contents_manager.root_dir) / url2path(path)
return Path(self.contents_manager.root_dir).absolute() / url2path(path)

@tornado.web.authenticated
async def get(self, path: str = ""):
Expand Down
5 changes: 4 additions & 1 deletion src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -943,10 +943,13 @@ namespace Private {

// Update the config file
const filePath = PathExt.join(model.path, manager.configurationFilename);
// Remove `path` if it exists - as it is user specific
const toSave = { ...model };
delete toSave.path;
await contentService.save(filePath, {
type: 'file',
format: 'text',
content: JSON.stringify(model)
content: JSON.stringify(toSave)
});

return toastId;
Expand Down
File renamed without changes.

0 comments on commit f519579

Please sign in to comment.