0
0
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:
Karl Hobley 2016-09-14 12:14:15 +01:00 committed by Matt Westcott
parent d60bde68c3
commit 005e2e7a37

View File

@ -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':