Skip to content

Commit

Permalink
remove menu item "Delete page…" from toolbar
Browse files Browse the repository at this point in the history
As discussed with @fsbraun on Slack, pages shall exclusively be deletable through the page tree but not through the toolbar.
  • Loading branch information
jrief committed Jan 9, 2024
1 parent d8f73fd commit 2a7090b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
4.2 (in progress)
=================

Features:
---------
* Remove menu item "Delete page…" from toolbar.


4.1.0 (2023-12-22)
==================

Expand Down
7 changes: 0 additions & 7 deletions cms/cms_toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,3 @@ def add_page_menu(self):
disabled=(not edit_mode or not can_change),
on_success=refresh,
)

# delete
delete_url = admin_reverse('cms_page_delete', args=(self.page.pk,))
delete_disabled = not edit_mode or not user_can_delete_page(self.request.user, page=self.page)
on_delete_redirect_url = self.get_on_delete_redirect_url()
current_page_menu.add_modal_item(_('Delete page'), url=delete_url, on_close=on_delete_redirect_url,
disabled=delete_disabled)

0 comments on commit 2a7090b

Please sign in to comment.