misc: always skip cells attached to snapshot pages (#28038)

This commit is contained in:
Frédéric Péters 2018-11-15 11:13:49 +01:00
parent 0caf6fa965
commit d9df32c8a6
2 changed files with 4 additions and 2 deletions

View File

@ -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,

View File

@ -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