mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Do not use Site.find_for_request() in the admin
This commit is contained in:
parent
c8a8689cee
commit
441bcde1ad
@ -16,7 +16,7 @@ from wagtail.admin.filters import (
|
||||
LockedPagesReportFilterSet, SiteHistoryReportFilterSet, WorkflowReportFilterSet,
|
||||
WorkflowTasksReportFilterSet)
|
||||
from wagtail.core.models import (
|
||||
Page, PageLogEntry, Site, TaskState, UserPagePermissionsProxy, WorkflowState)
|
||||
Page, PageLogEntry, TaskState, UserPagePermissionsProxy, WorkflowState)
|
||||
|
||||
|
||||
class Echo:
|
||||
@ -383,7 +383,8 @@ class LogEntriesView(ReportView):
|
||||
q = Q(
|
||||
page__in=UserPagePermissionsProxy(self.request.user).explorable_pages().values_list('pk', flat=True)
|
||||
)
|
||||
root_page_permissions = Site.find_for_request(self.request).root_page.permissions_for_user(self.request.user)
|
||||
|
||||
root_page_permissions = Page.get_first_root_node().permissions_for_user(self.request.user)
|
||||
if (
|
||||
self.request.user.is_superuser
|
||||
or root_page_permissions.can_add_subpage() or root_page_permissions.can_edit()
|
||||
|
Loading…
Reference in New Issue
Block a user