This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit b997b6f0a445ebfc3323d0e0226e068d080112ac
Author: Dillon Walls <[email protected]>
AuthorDate: Fri Jul 21 03:41:14 2023 +0000

    [#8516] Wiki - delete all page models when deleted and rely on artifact 
deletion tweaks instead of naive mongo .remove()
---
 ForgeWiki/forgewiki/wiki_main.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index b92285e20..f1014f180 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -370,8 +370,8 @@ The wiki uses [Markdown](%s) syntax.
 
     def uninstall(self, project):
         "Remove all the tool's artifacts from the database"
-        WM.WikiAttachment.query.remove(dict(app_config_id=self.config._id))
-        WM.Page.query.remove(dict(app_config_id=self.config._id))
+        for page in WM.Page.query.find(dict(app_config_id=self.config._id)):
+            page.delete()
         WM.Globals.query.remove(dict(app_config_id=self.config._id))
         super().uninstall(project)
 

Reply via email to