mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Also refs: - https://github.com/simonw/datasette-sentry/issues/1 - https://github.com/simonw/datasette-show-errors/issues/2
20 lines
476 B
Python
20 lines
476 B
Python
from os import stat
|
|
from datasette import hookimpl, Response
|
|
|
|
|
|
@hookimpl(trylast=True)
|
|
def forbidden(datasette, request, message):
|
|
async def inner():
|
|
return Response.html(
|
|
await datasette.render_template(
|
|
"error.html",
|
|
{
|
|
"title": "Forbidden",
|
|
"error": message,
|
|
},
|
|
request=request,
|
|
),
|
|
status=403,
|
|
)
|
|
|
|
return inner
|