From 556285b198db65f81f3fbd9d5eec59e94c2720a0 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Fri, 28 Apr 2023 14:21:21 -0700 Subject: [PATCH 1/1] added a line to fix persistence with deleted revs kaylea realized that we need to initialize the old_rev_data dictionary or it fails when the first revision to a page is deleted. This patch is from kaylea and modified by mako. --- wikiq | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wikiq b/wikiq index 0543a33..4a5c129 100755 --- a/wikiq +++ b/wikiq @@ -367,6 +367,8 @@ class WikiqParser(): rev_data['collapsed_revs'] = rev.collapsed_revs if self.persist != PersistMethod.none: + # initialize an empty dictionary before assigning things into it. this catches bugs if the first revision is deleted + old_rev_data = {} if rev.deleted.text: for k in ["token_revs", "tokens_added", "tokens_removed", "tokens_window"]: old_rev_data[k] = None -- 2.39.5