8000 refactor: Replace PageAdmin.delete_view by two smaller methods by jrief · Pull Request #7995 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

refactor: Replace PageAdmin.delete_view by two smaller methods #7995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Let pageadmin.has_change_permission(obj=None) return `page_permissi…
…ons.user_can_change_at_least_one_page` instead of `False.
  • Loading branch information
Github Release Action committed Sep 11, 2024
commit 79561a30545c275d1616970b25a537a7a6355bae
9 changes: 6 additions & 3 deletions cms/admin/pageadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,13 @@ def has_change_permission(self, request, obj=None):
Return true if the current user has permission on the page.
Return the string 'All' if the user has all rights.
"""
if obj is None:
return

site = get_site(request)
if obj is None:
# Checks if user can change at least one page
return page_permissions.user_can_change_at_least_one_page(
user=request.user,
site=site,
)
return page_permissions.user_can_change_page(request.user, page=obj, site=site)

def has_change_advanced_settings_permission(self, request, obj=None):
Expand Down
Loading
0