From ff5a9d1cd8e6499d3589b58e4c9d702aabe78733 Mon Sep 17 00:00:00 2001
From: Nicolas Dumazet <nicolas.dumazet@nexedi.com>
Date: Fri, 4 Feb 2011 08:43:14 +0000
Subject: [PATCH] Fix initialization of site: do not clear activities on the
 second call.

addERP5Tool might be clever now, and avoids recreating portal_activities
if it already exists, but the line just after should *not* be run if
the tool already exists, or else we simply clear all activities generating
during BT5 install.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43012 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/ERP5Site.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/product/ERP5/ERP5Site.py b/product/ERP5/ERP5Site.py
index 262d7868fa..adb9b8e6d7 100644
--- a/product/ERP5/ERP5Site.py
+++ b/product/ERP5/ERP5Site.py
@@ -1621,7 +1621,7 @@ class ERP5Generator(PortalGenerator):
     make sure that we do not put un the queue the full reindexation
     """
     # Add Activity Tool
-    if create_activities:
+    if create_activities and not p.hasObject('portal_activities'):
       addERP5Tool(p, 'portal_activities', 'Activity Tool')
       # Initialize Activities
       p.portal_activities.manageClearActivities(keep=0)
-- 
2.30.9