Commit 1b8b06d0 authored by Jérome Perrin's avatar Jérome Perrin

InventoryBrain: lookup nodes & resource unrestrictedly

Inventory API does not depend on security
Also fix some pylint complains
parent 6ab1f10b
...@@ -15,7 +15,6 @@ from Products.ZSQLCatalog.zsqlbrain import ZSQLBrain ...@@ -15,7 +15,6 @@ from Products.ZSQLCatalog.zsqlbrain import ZSQLBrain
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from ZTUtils import make_query from ZTUtils import make_query
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from zLOG import LOG, PROBLEM
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
from ComputedAttribute import ComputedAttribute from ComputedAttribute import ComputedAttribute
...@@ -41,6 +40,7 @@ class ComputedAttributeGetItemCompatibleMixin(ZSQLBrain): ...@@ -41,6 +40,7 @@ class ComputedAttributeGetItemCompatibleMixin(ZSQLBrain):
ComputedAttributeGetItemCompatibleMixin.__getitem__ ComputedAttributeGetItemCompatibleMixin.__getitem__
# ComputedAttribute compatibility for __getitem__ # ComputedAttribute compatibility for __getitem__
# pylint: disable=E0102
def __getitem__(self, name): def __getitem__(self, name):
item = self.__super__getitem__(name) item = self.__super__getitem__(name)
if isinstance(item, ComputedAttribute): if isinstance(item, ComputedAttribute):
...@@ -91,7 +91,7 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin): ...@@ -91,7 +91,7 @@ class InventoryListBrain(ComputedAttributeGetItemCompatibleMixin):
try: try:
return uid_cache[uid] return uid_cache[uid]
except KeyError: except KeyError:
result_list = self.portal_catalog(uid=uid, limit=1, result_list = self.portal_catalog.unrestrictedSearchResults(uid=uid, limit=1,
select_dict=dict(title=None, relative_url=None)) select_dict=dict(title=None, relative_url=None))
result = None result = None
if result_list: if result_list:
......
41168 41169
\ No newline at end of file \ No newline at end of file
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