mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
New forbidden() plugin hook, closes #812
This commit is contained in:
parent
3ec5b1abf6
commit
549b1c2063
8 changed files with 100 additions and 20 deletions
|
|
@ -245,3 +245,10 @@ def register_magic_parameters():
|
|||
("request", request),
|
||||
("uuid", uuid),
|
||||
]
|
||||
|
||||
|
||||
@hookimpl
|
||||
def forbidden(datasette, request, message):
|
||||
datasette._last_forbidden_message = message
|
||||
if request.path == "/data2":
|
||||
return Response.redirect("/login?message=" + message)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue