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:
|
if not instance.page_id:
|
||||||
return
|
return
|
||||||
page = instance.page
|
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()
|
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')
|
resp.form['site_file'] = Upload('site-export.json', site_export, 'application/json')
|
||||||
with CaptureQueriesContext(connection) as ctx:
|
with CaptureQueriesContext(connection) as ctx:
|
||||||
resp = resp.form.submit()
|
resp = resp.form.submit()
|
||||||
assert len(ctx.captured_queries) in [1140, 1141]
|
assert len(ctx.captured_queries) in [853, 854]
|
||||||
|
|
||||||
Page.objects.all().delete()
|
Page.objects.all().delete()
|
||||||
assert LinkCell.objects.count() == 0
|
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')
|
resp.form['site_file'] = Upload('site-export.json', site_export, 'application/json')
|
||||||
with CaptureQueriesContext(connection) as ctx:
|
with CaptureQueriesContext(connection) as ctx:
|
||||||
resp = resp.form.submit()
|
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(
|
assert set(Page.objects.get(slug='one').related_cells['cell_types']) == set(
|
||||||
['data_textcell', 'data_linkcell']
|
['data_textcell', 'data_linkcell']
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue