Commit 48cae5ad authored by Ivan Tyagov's avatar Ivan Tyagov

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
parent 2d1074a2
......@@ -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]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment