Skip to content

Commit

Permalink
Fix bug in api/contents requests for an allowed copy (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiersten-stokes authored Aug 2, 2022
1 parent 54164ac commit a8bf3f6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions jupyter_server/services/contents/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ async def post(self, path=""):
raise web.HTTPError(400, f"Cannot copy file or directory {path!r}")
else:
await self._copy(copy_from, path)

ext = model.get("ext", "")
type = model.get("type", "")
if type not in {None, "", "directory", "file", "notebook"}:
# fall back to file if unknown type
type = "file"
await self._new_untitled(path, type=type, ext=ext)
else:
ext = model.get("ext", "")
type = model.get("type", "")
if type not in {None, "", "directory", "file", "notebook"}:
# fall back to file if unknown type
type = "file"
await self._new_untitled(path, type=type, ext=ext)
else:
await self._new_untitled(path)

Expand Down

0 comments on commit a8bf3f6

Please sign in to comment.