kopia lustrzana https://github.com/wagtail/wagtail
Use content type cache in page search view
rodzic
f45b0a4ad5
commit
b1a1989899
|
@ -33,7 +33,7 @@ class TestPageSearch(WagtailTestUtils, TransactionTestCase):
|
|||
self.assertTemplateUsed(response, "wagtailadmin/pages/search.html")
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
with self.assertNumQueries(23):
|
||||
with self.assertNumQueries(22):
|
||||
self.get()
|
||||
|
||||
def test_search(self):
|
||||
|
|
|
@ -114,7 +114,7 @@ class SearchView(PageListingMixin, PermissionCheckedMixin, BaseListingView):
|
|||
# Facets
|
||||
if pages.supports_facet:
|
||||
self.content_types = [
|
||||
(ContentType.objects.get(id=content_type_id), count)
|
||||
(ContentType.objects.get_for_id(content_type_id), count)
|
||||
for content_type_id, count in self.all_pages.facet(
|
||||
"content_type_id"
|
||||
).items()
|
||||
|
|
Ładowanie…
Reference in New Issue