From 21c4d803dd2d4c87355b253c5ad871423c99aa0f Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 12 Jun 2024 10:20:21 +0100 Subject: [PATCH] Tweak script --- slides.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/slides.md b/slides.md index 1d92431..f3d66ca 100644 --- a/slides.md +++ b/slides.md @@ -33,12 +33,12 @@ background: /intranet.png --- @@ -76,6 +77,7 @@ backgroundSize: contain - They'd made a new "Sysadmin" section a while ago, before switching strategy to move pages in the existing tree - They then deleted the wrong one - Sure, Wagtail shows a confirmation when you're deleting pages, but when you're deleting a lot of pages, and expecting to delete pages, you might not read the message perfectly +- "Radical reorganisation" my boss called it - With the content gone, I had to restore from backups. --> @@ -100,7 +102,7 @@ layout: section @@ -113,7 +115,7 @@ layout: section --- @@ -138,7 +140,7 @@ child_pages = sysadmin_page.get_descendants() --- @@ -160,13 +162,13 @@ collector.collect(list(child_pages) + [sysadmin_page]) --- @@ -295,7 +297,6 @@ layout: fact - The search index objects (we use postgres) were picked up by `NestedObjects` - They didn't like being restored - So I skipped them and moved on, knowing I'd just rebuild the index later. -- `manage.py fixtree` also reports any tree issues, which there weren't --> --- @@ -322,13 +323,14 @@ class: flex justify-center flex-col items-center - The tense bit - Once I was happy, I ran the same steps on production - Our intranet runs on Heroku, so I had to do a few dances to get the JSON file up there. -- [click]Before I began, I did a backup, because I'm a good sysadmin -- [click]With the data file in place, [click]I crossed everything and ran `loaddata` +- [click]Before I began, I did a backup + - Because I'm a good sysadmin +- [click]With the data file in place, I crossed everything[click] and ran `loaddata` - Pages popped up in the admin as if they never left - [click]`checktree` worked. - [click]`update_index` worked. - [click] As did `rebuild_reference_index` - - The new pages were now findable + - The new pages were now findable and searchable --> --- @@ -344,9 +346,9 @@ background: /sysadmin.png - No content freeze - No data loss - Most people didn't even know there was an issue -- I've used this trick a a few times in my career, for both Wagtail and plain Django sites +- I've used this trick a few times in my career, for both Wagtail and plain Django sites - Ironically, just a few weeks after the blog post was published - - Works identically for Django sites, so long as you know how to reconstruct the delete query. + - Works identically for any Django project, so long as you know how to reconstruct the delete query. - Hopefully this helps you out as much as it has me! -->