Commit 0f2efaf3 authored by Ivan Tyagov's avatar Ivan Tyagov

Do not log messages for every call of security calculation (one per transaction).

Try to support migration of old instances (containing old erp5_property_sheets)
with recent products. This is especially visible with BusinessTemplate property sheet
when new filesystem versions require an up to date erp5_property_sheets bt5 which itself
can not be installed.
parent 2717b20a
......@@ -4968,9 +4968,14 @@ Business Template is a set of definitions, such as skins, portal types and categ
self._catalog_local_role_key_item = \
CatalogLocalRoleKeyTemplateItem(
self.getTemplateCatalogLocalRoleKeyList())
self._catalog_security_uid_column_item = \
try:
self._catalog_security_uid_column_item = \
CatalogSecurityUidColumnTemplateItem(
self.getTemplateCatalogSecurityUidColumnList())
except AttributeError:
# be backwards compatible with old zope instances which
# do not contain recent version of erp5_property_sheets
pass
security.declareProtected(Permissions.ManagePortal, 'build')
def build(self, no_action=0):
......@@ -5584,7 +5589,12 @@ Business Template is a set of definitions, such as skins, portal types and categ
(SimpleItem.SimpleItem,), {'__module__': module_id}))
for item_name in self._item_name_list:
getattr(self, item_name).importFile(bta)
item_object = getattr(self, item_name)
# this check is due to backwards compatability when there can be a
# difference between install erp5_property_sheets (esp. BusinessTemplate
# property sheet)
if item_object is not None:
item_object.importFile(bta)
# Remove temporary modules created above to allow import of real modules
# (during the installation).
......
......@@ -515,8 +515,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
try:
local_roles_group_id = brain.local_roles_group_id
except AttributeError:
LOG("ERP5Catalog", PROBLEM,
"sql_search_security is not up to date, falling back.")
# backwards compatability in cases when catalog use default schema
local_roles_group_id = ''
security_uid_dict.setdefault(local_roles_group_id,
[]).append(brain.uid)
......
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