data: don't build the cache on cell update (#51472)
This commit is contained in:
parent
bf3cb40c5c
commit
95a466f1c7
|
@ -2014,4 +2014,8 @@ def cell_maintain_page_cell_cache(sender, instance=None, **kwargs):
|
|||
if not instance.page_id:
|
||||
return
|
||||
page = instance.page
|
||||
if kwargs.get('created') is False:
|
||||
# don't build the cache on update, but update page's last_update_timestamp
|
||||
page.save(update_fields=['last_update_timestamp'])
|
||||
return
|
||||
page.build_cell_cache()
|
||||
|
|
|
@ -832,7 +832,7 @@ def test_site_export_import_json(app, admin_user):
|
|||
resp.form['site_file'] = Upload('site-export.json', site_export, 'application/json')
|
||||
with CaptureQueriesContext(connection) as ctx:
|
||||
resp = resp.form.submit()
|
||||
assert len(ctx.captured_queries) in [1140, 1141]
|
||||
assert len(ctx.captured_queries) in [853, 854]
|
||||
|
||||
Page.objects.all().delete()
|
||||
assert LinkCell.objects.count() == 0
|
||||
|
@ -841,7 +841,7 @@ def test_site_export_import_json(app, admin_user):
|
|||
resp.form['site_file'] = Upload('site-export.json', site_export, 'application/json')
|
||||
with CaptureQueriesContext(connection) as ctx:
|
||||
resp = resp.form.submit()
|
||||
assert len(ctx.captured_queries) == 665
|
||||
assert len(ctx.captured_queries) == 378
|
||||
assert set(Page.objects.get(slug='one').related_cells['cell_types']) == set(
|
||||
['data_textcell', 'data_linkcell']
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue