mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Applied Black
This commit is contained in:
parent
719e757252
commit
9b5a73ba4c
1 changed files with 7 additions and 2 deletions
|
|
@ -71,8 +71,13 @@ class BaseView:
|
||||||
|
|
||||||
async def method_not_allowed(self, request):
|
async def method_not_allowed(self, request):
|
||||||
print(request.headers)
|
print(request.headers)
|
||||||
if request.path.endswith(".json") or request.headers.get("content-type") == "application/json":
|
if (
|
||||||
return Response.json({"ok": False, "error": "Method not allowed"}, status=405)
|
request.path.endswith(".json")
|
||||||
|
or request.headers.get("content-type") == "application/json"
|
||||||
|
):
|
||||||
|
return Response.json(
|
||||||
|
{"ok": False, "error": "Method not allowed"}, status=405
|
||||||
|
)
|
||||||
return Response.text("Method not allowed", status=405)
|
return Response.text("Method not allowed", status=405)
|
||||||
|
|
||||||
async def options(self, request, *args, **kwargs):
|
async def options(self, request, *args, **kwargs):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue