From 84e41cc23f3991b956832827113731ae1f0a3f84 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Tue, 16 Feb 2021 12:02:50 +0000 Subject: [PATCH] Just fetch alias_of when checking ancestor view permissions --- wagtail/core/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wagtail/core/models.py b/wagtail/core/models.py index 35f24e4898..67772db8bc 100644 --- a/wagtail/core/models.py +++ b/wagtail/core/models.py @@ -2694,7 +2694,7 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase): add_page_to_check_list(self) # Check each ancestor for view restrictions as well - for page in self.get_ancestors(): + for page in self.get_ancestors().only('alias_of'): add_page_to_check_list(page) return PageViewRestriction.objects.filter(page_id__in=page_ids_to_check)