From d3e817af7a7ec0d3c07f6e2a24777b8999986e79 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Tue, 28 Aug 2012 15:16:19 +0200
Subject: [PATCH] portal_components might not exist yet

---
 product/ERP5/ERP5Site.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/ERP5Site.py b/product/ERP5/ERP5Site.py
index a23358fb92..d8dc774c44 100644
--- a/product/ERP5/ERP5Site.py
+++ b/product/ERP5/ERP5Site.py
@@ -485,7 +485,11 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
 
     # Make sure that reset is not performed when creating a new site
     if not getattr(self, '_v_bootstrapping', False):
-      self.portal_components.resetOnceAtTransactionBoundary()
+      try:
+        self.portal_components.resetOnceAtTransactionBoundary()
+      except AttributeError:
+        # This should only happen before erp5_core is installed
+        pass
 
   version_priority_list = property(getVersionPriorityList,
                                    setVersionPriorityList)
-- 
2.30.9