From d9df32c8a6695c7287df1a9cfda22ad56908618b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 15 Nov 2018 11:13:49 +0100 Subject: [PATCH] misc: always skip cells attached to snapshot pages (#28038) --- combo/apps/assets/views.py | 3 +-- combo/data/models.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/combo/apps/assets/views.py b/combo/apps/assets/views.py index 986db56d..2f53c4bf 100644 --- a/combo/apps/assets/views.py +++ b/combo/apps/assets/views.py @@ -94,8 +94,7 @@ class SlotAsset(object): uniq_slots = {} uniq_slots.update(settings.COMBO_ASSET_SLOTS) for cell in CellBase.get_cells( - cell_filter=lambda x: bool(x.get_asset_slots), - page__snapshot__isnull=True): + cell_filter=lambda x: bool(x.get_asset_slots)): uniq_slots.update(cell.get_asset_slots()) for key, value in uniq_slots.items(): yield cls(key, diff --git a/combo/data/models.py b/combo/data/models.py index 3430fa01..543f6a8a 100644 --- a/combo/data/models.py +++ b/combo/data/models.py @@ -555,6 +555,9 @@ class CellBase(six.with_metaclass(CellMeta, models.Model)): pages = [kwargs['page']] elif 'page__in' in kwargs: pages = kwargs['page__in'] + else: + # if there are not explicit page, limit to non-snapshot pages + kwargs['page__snapshot__isnull'] = True cell_classes = get_cell_classes() if pages and not skip_cell_cache: # if there's a request for some specific pages, limit cell types