mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-29 17:36:49 +01:00
Add before_delete_page hook
This commit is contained in:
parent
d60bde68c3
commit
005e2e7a37
@ -490,6 +490,11 @@ def delete(request, page_id):
|
||||
if not page.permissions_for_user(request.user).can_delete():
|
||||
raise PermissionDenied
|
||||
|
||||
for fn in hooks.get_hooks('before_delete_page'):
|
||||
result = fn(request, page)
|
||||
if hasattr(result, 'status_code'):
|
||||
return result
|
||||
|
||||
next_url = get_valid_next_url_from_request(request)
|
||||
|
||||
if request.method == 'POST':
|
||||
|
Loading…
Reference in New Issue
Block a user