Skip to content

Commit

Permalink
Merge branch 'main' into identity
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsailer authored Jul 26, 2022
2 parents f2740d7 + e59610b commit b050a8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
files: \.py$

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
rev: v0.971
hooks:
- id: mypy
additional_dependencies: [types-requests]
Expand All @@ -41,7 +41,7 @@ repos:
- id: prettier

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.1
rev: v2.37.2
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand All @@ -67,13 +67,13 @@ repos:
stages: [manual]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.19.0
rev: v8.20.0
hooks:
- id: eslint
stages: [manual]

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.17.0
rev: 0.17.1
hooks:
- id: check-jsonschema
name: "Check GitHub Workflows"
Expand Down
6 changes: 5 additions & 1 deletion jupyter_server/services/contents/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ async def get(self, path=""):

type = self.get_query_argument("type", default=None)
if type not in {None, "directory", "file", "notebook"}:
raise web.HTTPError(400, "Type %r is invalid" % type)
# fall back to file if unknown type
type = "file"

format = self.get_query_argument("format", default=None)
if format not in {None, "text", "base64"}:
Expand Down Expand Up @@ -222,6 +223,9 @@ async def post(self, path=""):
copy_from = model.get("copy_from")
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"
if copy_from:
await self._copy(copy_from, path)
else:
Expand Down

0 comments on commit b050a8e

Please sign in to comment.