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

Fallback new file type to file for contents put #1013

Merged
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
3 changes: 3 additions & 0 deletions jupyter_server/services/contents/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ async def put(self, path=""):
raise web.HTTPError(400, f"Cannot create file or directory {path!r}")

exists = await ensure_async(self.contents_manager.file_exists(path))
if model.get("type", "") not in {None, "", "directory", "file", "notebook"}:
# fall back to file if unknown type
model["type"] = "file"
if exists:
await self._save(model, path)
else:
Expand Down