Skip to content

Commit

Permalink
Use datasette.Forbidden, closes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Feb 27, 2024
1 parent 3621080 commit 3d3e471
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions datasette_write/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from datasette import hookimpl
from datasette.utils.asgi import Response
from datasette import hookimpl, Forbidden, Response
from urllib.parse import urlencode
import re

Expand All @@ -8,7 +7,7 @@ async def write(request, datasette):
if not await datasette.permission_allowed(
request.actor, "datasette-write", default=False
):
return Response.html("Permission denied for datasette-write", status=403)
raise Forbidden("Permission denied for datasette-write")
databases = [
db
for db in datasette.databases.values()
Expand Down

0 comments on commit 3d3e471

Please sign in to comment.