Skip to content

Commit

Permalink
Fallback new file type to file for contents put (jupyter-server#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
a3626a authored Oct 6, 2022
1 parent 4604ce0 commit ba92f31
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit ba92f31

Please sign in to comment.