From 3e6999324d5f27927d915a3a6c79688e0284151f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=B0=BD=ED=99=98?= Date: Thu, 6 Oct 2022 15:00:37 +0900 Subject: [PATCH] Fallback new file type to file for contents put --- jupyter_server/services/contents/handlers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jupyter_server/services/contents/handlers.py b/jupyter_server/services/contents/handlers.py index 388e946cbf..1611a43ab9 100644 --- a/jupyter_server/services/contents/handlers.py +++ b/jupyter_server/services/contents/handlers.py @@ -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: