From b380703bcf175f4e0a4a31998b756fe443937a95 Mon Sep 17 00:00:00 2001 From: Bertrand Bordage Date: Wed, 22 Nov 2017 18:02:10 +0100 Subject: [PATCH] Fixes the function to get ancestors content types. --- wagtail/contrib/postgres_search/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wagtail/contrib/postgres_search/utils.py b/wagtail/contrib/postgres_search/utils.py index a9a5df284c..f3f42f97ac 100644 --- a/wagtail/contrib/postgres_search/utils.py +++ b/wagtail/contrib/postgres_search/utils.py @@ -68,11 +68,12 @@ def get_content_type_pk(model): def get_ancestors_content_types_pks(model): """ - Returns content types ids for the descendants of this model, excluding it. + Returns content types ids for the ancestors of this model, excluding it. """ from django.contrib.contenttypes.models import ContentType return [ct.pk for ct in - ContentType.objects.get_for_models(*model._meta.parents).values()] + ContentType.objects.get_for_models(*model._meta.get_parent_list()) + .values()] def get_descendants_content_types_pks(model):