Commit ca302cf5 authored by Jérome Perrin's avatar Jérome Perrin

CodingStyle: cache acceptable skin prefixes at transaction

Caching forever would produce wrong results after installing a business
template containing interfaces, using a transaction cache is enough
(actually it may not even be needed).
parent f40b2c66
Pipeline #8904 failed with stage
in 0 seconds
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
# #
############################################################################## ##############################################################################
from Products.ERP5Type.Cache import transactional_cached
from Products.ERP5Type.ObjectMessage import ObjectMessage from Products.ERP5Type.ObjectMessage import ObjectMessage
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
...@@ -36,19 +37,11 @@ def getLegacyCallableIdItemList(self): ...@@ -36,19 +37,11 @@ def getLegacyCallableIdItemList(self):
('WebSection_getPermanentURLForView', 'getPermanentURL'), ('WebSection_getPermanentURLForView', 'getPermanentURL'),
) )
# Define acceptable prefix list for skin folder items
skin_prefix_list = None
def getSkinPrefixList(self):
"""
Return the list of acceptable prefix. Cache the result.
TODO: make the cache more efficient (read-only transaction @transactional_cached()
cache) def getSkinPrefixList(self):
"""Return the list of acceptable prefixes for skins.
""" """
global skin_prefix_list
if skin_prefix_list:
return skin_prefix_list
portal = self.getPortalObject() portal = self.getPortalObject()
# Add portal types prefix # Add portal types prefix
......
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