From 48cae5ad79f8dc0f580824e23cc09dfc23713ba6 Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Thu, 6 Dec 2007 11:32:10 +0000
Subject: [PATCH] Do not fail when doing an update of business template on old
 catalog instance (ERP5 site).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18050 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/BusinessTemplate.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py
index 3fc8d4a4e4..f567735887 100644
--- a/product/ERP5/Document/BusinessTemplate.py
+++ b/product/ERP5/Document/BusinessTemplate.py
@@ -3285,7 +3285,7 @@ class CatalogDateTimeKeyTemplateItem(BaseTemplateItem):
     if catalog is None:
       LOG('BusinessTemplate', 0, 'no SQL catalog was available')
       return
-    sql_datetime_keys = list(catalog.sql_catalog_datetime_search_keys)
+    sql_datetime_keys = list(getattr(catalog, 'sql_catalog_datetime_search_keys', []))
     key_list = []
     for key in self._archive.keys():
       if key in sql_datetime_keys:
@@ -3311,7 +3311,7 @@ class CatalogDateTimeKeyTemplateItem(BaseTemplateItem):
       LOG('BusinessTemplate', 0, 'no SQL catalog was available')
       return
 
-    sql_datetime_keys = list(catalog.sql_catalog_datetime_search_keys)
+    sql_datetime_keys = list(getattr(catalog, 'sql_catalog_datetime_search_keys', []))
     if context.getTemplateFormatVersion() == 1:
       if len(self._objects.keys()) == 0: # needed because of pop()
         return
@@ -3338,7 +3338,7 @@ class CatalogDateTimeKeyTemplateItem(BaseTemplateItem):
     if catalog is None:
       LOG('BusinessTemplate', 0, 'no SQL catalog was available - uninstall')
       return
-    sql_datetime_keys = list(catalog.sql_catalog_datetime_search_keys)
+    sql_datetime_keys = list(getattr(catalog, 'sql_catalog_datetime_search_keys', []))
     object_path = kw.get('object_path', None)
     if object_path is not None:
       object_keys = [object_path]
-- 
2.30.9