Applied Black

This commit is contained in:
Simon Willison 2022-11-02 21:46:05 -07:00
commit 9b5a73ba4c

View file

@ -71,8 +71,13 @@ class BaseView:
async def method_not_allowed(self, request):
print(request.headers)
if request.path.endswith(".json") or request.headers.get("content-type") == "application/json":
return Response.json({"ok": False, "error": "Method not allowed"}, status=405)
if (
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)
async def options(self, request, *args, **kwargs):