Skip to content

Commit ba92f31

Browse files
authored
Fallback new file type to file for contents put (#1013)
1 parent 4604ce0 commit ba92f31

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jupyter_server/services/contents/handlers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ async def put(self, path=""):
254254
raise web.HTTPError(400, f"Cannot create file or directory {path!r}")
255255

256256
exists = await ensure_async(self.contents_manager.file_exists(path))
257+
if model.get("type", "") not in {None, "", "directory", "file", "notebook"}:
258+
# fall back to file if unknown type
259+
model["type"] = "file"
257260
if exists:
258261
await self._save(model, path)
259262
else:

0 commit comments

Comments
 (0)